Commit af33d0e4 by BellCodeEditor

save project

parent 69fca0c8
Showing with 6 additions and 6 deletions
with open(r'/Users/zll/Desktop/sales_list.txt','r',encoding='utf-8') as f: with open(r'/Users/zll/Desktop/sale_list.txt','r',encoding='utf-8') as f:
a=f.readlines() a=f.readlines()
zz=[]
zz=[] for i in a:
for i in a:
aa=i.split() aa=i.split()
sum=0 sum=0
for x in aa[1:]: for x in aa[1:]:
...@@ -10,4 +9,5 @@ with open(r'/Users/zll/Desktop/sales_list.txt','r',encoding='utf-8') as f: ...@@ -10,4 +9,5 @@ with open(r'/Users/zll/Desktop/sales_list.txt','r',encoding='utf-8') as f:
qq=aa[0]+str(sum) qq=aa[0]+str(sum)
zz.append(qq) zz.append(qq)
print(zz) print(zz)
with open(r'/Users/zll/Desktop/sale_list.txt','a',encoding='utf-8') as f:
\ No newline at end of file f.write(zz)
\ 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