Commit eb53a1d3 by BellCodeEditor

save project

parent d1536a55
Showing with 23 additions and 0 deletions
with open(r'C:\Users\Administrator\Documents\lesson13_2\sales_list.txt','r',encoding='UTF-8')as file1:
a=file1.readlines()
#print(a)
l1=[]
for i in a:
#print(i)
data=i.split()
#print(data[0])
#print(data[1:])
sum=0
for s1 in data[1:]:
um=sum+int(s1)
r1=data[0]+str(sum)
#print(r1)
l1.append(r1)
with open(r'C:\Users\Administrator\Documents\lesson13_2\sales_list1.txt','a',encoding='UTF-8')as file2:
file2.writelines(l1)
\ No newline at end of file
dddd 12 45 67 89
wwww 65 89
rrr 67 94 90
llll 46 78 34 13
\ 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