Commit 62b2b213 by BellCodeEditor

save project

parent 4c3c4df3
Showing with 5 additions and 3 deletions
with open(r"c:\Users\Administrator\Documents\lesson13-3\sales_list.txt","r",encoding="utf-8")as Ze:
Z=Ze.readlines()
q=[]
for i in Z:
#print(i)
C=i.split()
......@@ -7,7 +8,8 @@ for i in Z:
a=0
for i in C[1:]:
a=a+int(i)
d=C[0]+str(a)
print(d)
d=C[0]+str(a)+"/n"
q.append(d)
with open(r"c:\Users\Administrator\Documents\lesson13-3\sales_list.txt","w",encoding="utf-8")as Ze:
Ze.writelines(q)
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