Commit 46a12a73 by BellCodeEditor

save project

parent 7146447b
Showing with 5 additions and 0 deletions
with open (r'c:\Users\23636\Documents\lesson13-1\sales_list.txt','r',encoding = 'utf-8')as frfr:
a=frfr.readlines()
aaa=[]
for i in a:
s=i.split()
sum=0
for r in s[1:]:
sum=sum+int(r)
e=s[0]+str(sum)
aaa.append(e)
print(e)
with open (r'c:\Users\23636\Documents\lesson13-1\sales_list.txt','a',encoding = 'utf-8')as frfr:
frfr.writelines(aaa)
\ 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