Commit ede587d3 by BellCodeEditor

save project

parent b011ba71
Showing with 20 additions and 0 deletions
with open(r"c:\Users\qq\Documents\lesson13-1\sales_list.txt","r",encoding="utf-8")as diy:
a=diy.readlines()
sum1=[]
for i in a :
data=i.split()
# print(data[1:])
sum=0
for j in data[1:]:
sum=sum+int(j)
fx=data[0]+str(sum)+"\n"
sum1.append(fx)
with open(r"c:\Users\qq\Documents\lesson13-1\5520sales_list.txt","a",encoding="utf-8")as diy:
diy.writelines(sum1)
\ No newline at end of file
gfyh 1 4 4 444 654 574 54 65 5 4 65
egjhfer 358 8 8 4 4 848 454 5465 45 456 44
dcuydcgv 54 6544 54 54 544 5 4 545 4 579 8456 7 97 5
\ 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