Commit 579e87fe by BellCodeEditor

auto save

parent 6afb3a97
Showing with 3 additions and 5 deletions
...@@ -2,10 +2,8 @@ with open(r'c:\Users\hp\Documents\lesson13-1\sales_list.txt','r',encoding='utf-8 ...@@ -2,10 +2,8 @@ with open(r'c:\Users\hp\Documents\lesson13-1\sales_list.txt','r',encoding='utf-8
a=f.readlines() a=f.readlines()
for i in a: for i in a:
b=i.split() b=i.split()
print(b[0])
# print(b[1:])
sum=0 sum=0
for l in b[1:]: for l in b[1:]:
sum=sum+int(l) sum=sum+int(l)
b=b[0]+str(sum) n=b[0]+str(sum)
print(b) print(n)
\ 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