Commit 9c463359 by BellCodeEditor

save project

parent 8f150d4d
Showing with 5 additions and 1 deletions
with open(r'c:\Users\l\Desktop\sales_list.txt',"r",encoding='utf-8') as file:
a=file.readlines()
final_sum=[]
for i in a:
newdata=i.split()
#print(newdata[0])
......@@ -8,7 +9,10 @@ for i in a:
for sales in newdata[1:]:
sum=sum+int(sales)
ljtyyzs=newdata[0]+str(sum)
print(ljtyyzs)
final_sum.append(ljtyyzs)
with open(r'c:\Users\l\Desktop\sales_list.txt',"r",encoding='utf-8') as file:
a=file.writelines(ljtyyzs)
......
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