Commit 298a4d62 by BellCodeEditor

save project

parent ce6c64e5
Showing with 4 additions and 3 deletions
...@@ -2,7 +2,8 @@ with open(r"c:\Users\EDZ\Desktop\sales_list.txt","r",encoding='utf-8') as f: ...@@ -2,7 +2,8 @@ with open(r"c:\Users\EDZ\Desktop\sales_list.txt","r",encoding='utf-8') as f:
a = f.readlines() a = f.readlines()
for i in a: for i in a:
b = i.split() b = i.split()
sum = 0 sum = 0
for j in b[1:]: for j in b[1:]:
sum = sum + int(j) sum = sum + int(j)
print(b[0] + str(sum)) res = b[0] + ":" + str(sum) + "元"
\ No newline at end of file print(res)
\ 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