Commit 13b56be3 by BellCodeEditor

save project

parent 4781eed2
Showing with 12 additions and 2 deletions
with open() with open(r'c:\Users\HW\Documents\lesson13-3\sales_list.txt','r',encoding='utf-8') as file:
\ No newline at end of file str=file.readlines()
for data in str:
new_data=data.split()
a=new_data[1:]
b=0
for i in a:
b=b+int(i)
a=new_data[0]
print(a,b)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment