Commit 5aecbdf2 by BellCodeEditor

save project

parent b9fe1d65
Showing with 31 additions and 1 deletions
with open(r'C:\Users\Administrator\Documents\lesson13-1\sales_list.txt','r',encoding='utf-8') as f:
a=f.readlines()
fs=[]
for i in a:
d=i.split()
f=d[1:]
......@@ -7,5 +8,8 @@ for i in a:
for i in f:
s=s+int(i)
x=d[0]
c=x+str(s)
c='\n'+x+str(s)+'\n'
fs.append(c)
print(c)
with open(r'C:\Users\Administrator\Documents\lesson13-1\sales_list.txt','a',encoding='utf-8') as c:
c.writelines(fs)
......@@ -11,3 +11,29 @@
刘阳 11 15 22 11 23 26 22 15 17 52 12
王胜男 27 15 15 26 13 12 15
王娇 12 11 12 12 15 35 23 11
悟空348
诺依380
小贝182
李丽201
宋扬107
王明245
李强164
孙小白222
苏琪137
刘若若147
刘阳226
王胜男123
王娇131
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