Commit 4c6213df by BellCodeEditor

save project

parent 6a24912f
Showing with 13 additions and 5 deletions
f = []
with open(r'C:\Users\A25\Documents\lesson13-1\sales_list.txt','r',encoding='utf-8') as f1:
a = f1.readlines()
for i in a:
b = i.split()
c = b[1:]
print(c)
\ No newline at end of file
for j in a:
b = j.split()
c = 0
print(b)
for k in b[1:]:
c = c+int(k)
print(c)
d = b[0]+str(c)
print(d)
with open(r'C:\Users\A25\Desktop\新建文本文档.txt','a',encoding='utf-8') as f1:
f1.writelines(f)
\ 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