Commit da97a781 by BellCodeEditor

save project

parent a44805a1
Showing with 3 additions and 3 deletions
with open(r'c:\Users\GT\Documents\lesson13-1\sales_list.txt','r',encoding='utf-8') as files: with open(r'c:\Users\GT\Documents\lesson13-1\sales_list.txt','w',encoding='utf-8') as files:
a=files.readlines() a=files.readlines()
for i in a: for i in a:
b=i.split() b=i.split()
...@@ -6,4 +6,4 @@ with open(r'c:\Users\GT\Documents\lesson13-1\sales_list.txt','r',encoding='utf-8 ...@@ -6,4 +6,4 @@ with open(r'c:\Users\GT\Documents\lesson13-1\sales_list.txt','r',encoding='utf-8
for sales in b[1:]: for sales in b[1:]:
sum=sum+int(sales) sum=sum+int(sales)
result=b[0]+str(sum) result=b[0]+str(sum)
print(result)
\ No newline at end of file \ No newline at end of file
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