Commit 12e1fcf6 by BellCodeEditor

save project

parent c629d0e5
Showing with 5 additions and 5 deletions
...@@ -2,7 +2,8 @@ with open(r'c:\Users\Administrator\Desktop\sales_list.txt','r',encoding='utf-8') ...@@ -2,7 +2,8 @@ with open(r'c:\Users\Administrator\Desktop\sales_list.txt','r',encoding='utf-8')
a=file1.readlines() a=file1.readlines()
for i in a: for i in a:
b=i.split() b=i.split()
c=b[1:] sum=0
d=b[0] for sales in b[1:]:
print(d) sum+=int(sales)
print(c) c=b[0]+str(sum)
\ No newline at end of file print(c)
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