Commit 213c8d52 by BellCodeEditor

auto save

parent 302aefc7
Showing with 16 additions and 1 deletions
......@@ -2,3 +2,7 @@
人员 25 20 98 25
大润 25 26 97 25
剩下 25 26 98 18
发的169
人员168
大润173
剩下167
with open(r'c:\Users\win 10\Documents\lesson12-1\diy.py','r',encoding='utf-8') as ppp:
a=ppp.readlines()
o=[]
for i in a:
print(a)
d=i.split()
#print(d[1:])
sum=0
for b in d[1:]:
sum=sum+int(b)
r=d[0]+str(sum)+'\n'
#print(r)
o.append(r)
with open(r'c:\Users\win 10\Documents\lesson12-1\diy.py','a',encoding='utf-8') as ppp:
ppp.writelines(o)
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