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:
b=a.readlines()
# print(b)
for i in b:
c=i.split()
#print(c[0])
#print(c[1:])
d=0
for e in c[1:]:
d=d+e
print(d)
\ No newline at end of file
d=d+int(e)
f=c[0]+str(d)
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