Commit 66104ea8 by BellCodeEditor

auto save

parent 68619af2
Showing with 17 additions and 8 deletions
file = open(r'C:\Users\Administrator\Documents\lesson13-5\score.txt','r',encoding='utf-8')
a = readline()
b = []
for c in a:
d = i.split()
e = 0
for f in d[1:]:
e = e + int(d)
g = d[0] + str(e) + '\n'
b.append(g)
file = open(r'C:\Users\Administrator\Documents\lesson13-5\wdrt.txt','w',encoding='utf-8')
file.writelines(b)
file.close()
\ No newline at end of file
file = open(r'c:\Users\Administrator\Documents\lesson13_2\sales_list.txt','r',encoding='utf-8')
a = file.readlines()
h = []
for i in a:
date=i.split()
x = 0
for e in date[1:]:
x = x+int(e)
o = date[0]+str(x)+'\n'
h.append(o)
print(o)
file = open(r'c:\Users\Administrator\Desktop\da cong ming.txt','a',encoding='utf-8')
file.writelines(h)
file.close()
\ No newline at end of file
o = date[0]+str(x)
print(o)
\ 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