Commit 9c4ad0e0 by BellCodeEditor

save project

parent 9ef36035
Showing with 5 additions and 5 deletions
#a=file b=a c=data d=sum e=sales f=result
with open(r'c:\Users\Windows 7\Documents\lesson13-1\sales_list.txt','r',encoding='utf-8')as a: with open(r'c:\Users\Windows 7\Documents\lesson13-1\sales_list.txt','r',encoding='utf-8')as a:
b=a.readlines() b=a.readlines()
# print(b) # print(b)
for i in b: for i in b:
c=i.split() c=i.split()
#print(c[0])
#print(c[1:])
d=0 d=0
for e in c[1:]: for e in c[1:]:
d=d+e d=d+int(e)
print(d) f=c[0]+str(d)
\ No newline at end of file print(d)
\ 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