Commit 731b4b1a by BellCodeEditor

save project

parent 42ed129f
Showing with 11 additions and 13 deletions
with open(r'C:\Users\Administrator\Documents\lesson13-1\sales_list.txt','r',encoding='utf-8') as file: with open(r'C:\Users\Administrator\Documents\lesson13-1\sales_list.txt','r',encoding='utf-8') as file:
a=file.readlines() a=file.readlines()
#print(a) dd=[]
for i in a: for i in a:
b=i.split() b=i.split()
# print(b[1:]) c_1=0
c_111=0 for x in b[1:]:
dd=[] c_1=c_1+int(x)
for i in b[1:]: result=b[0]+str(c_1)+'\n'
c_111=c_111+int(i) dd.append(result)
result=b[0]+str(c_111)+'\n' with open(r'C:\Users\Administrator\Documents\lesson13-1\sales_list.txt','a',encoding='utf-8') as file:
dd.append(result) file.writelines(dd)
with open(r'C:\Users\Administrator\Desktop\test.txt','a',encoding='utf-8') as file: \ No newline at end of file
file.writelines(dd)
\ 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