Commit 701f57d3 by BellCodeEditor

save project

parent 3ed4f3ba
Showing with 6 additions and 4 deletions
with open(r"C:\Users\Administrator\Desktop\sales_list.txt","r",encoding="utf-8")as filel: with open(r"C:\Users\Administrator\Desktop\sales_list.txt","r",encoding="utf-8")as filel:
a=filel.readlines() a=filel.readlines()
msn=[]
for i in a: for i in a:
w=i.split() w=i.split()
# print(w[0]) # print(w[0])
...@@ -8,5 +8,8 @@ with open(r"C:\Users\Administrator\Desktop\sales_list.txt","r",encoding="utf-8") ...@@ -8,5 +8,8 @@ with open(r"C:\Users\Administrator\Desktop\sales_list.txt","r",encoding="utf-8")
e=0 e=0
for b in w[1:]: for b in w[1:]:
e=e+int(b) e=e+int(b)
name=w[0]+str(e) name=w[0]+str(e)+"\n"
print(name) msn.append(name)
\ No newline at end of file with open(r"C:\Users\Administrator\Desktop\sales_list.txt","a",encoding="utf-8")as filel:
filel.writelines(msn)
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