Commit cc38e22e by BellCodeEditor

save project

parent 10401446
Showing with 6 additions and 1 deletions
with open(r'C:\Users\Administrator\Desktop\sales_list.txt',"r",encoding="utf-8") as sales_list: with open(r'C:\Users\Administrator\Desktop\sales_list.txt',"r",encoding="utf-8") as sales_list:
x=sales_list.readlines() x=sales_list.readlines()
m=[]
for i in x: for i in x:
a=i.split() a=i.split()
c=a[1:] c=a[1:]
ab=0 ab=0
for b in c: for b in c:
ab=ab+int(b) ab=ab+int(b)
print(a[0]+str(ab)) cd=a[0]+str(ab)
m.append(cd+"\n")
with open (r'C:\Users\Administrator\Desktop\ni.txt','w',encoding='utf-8') as ni:
ni.writelines(m)
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