Commit f3994f6f by BellCodeEditor

save project

parent 75bfaa7b
Showing with 9 additions and 2 deletions
with open(r'c:\Users\Windows 10\Documents\lesson13-1\sales_list.txt',"r",encoding="utf-8") as file: with open(r'c:\Users\Windows 10\Documents\lesson13-1\sales_list.txt',"r",encoding="utf-8") as file:
a=file.readlines() a=file.readlines()
ff=[]
for i in a: for i in a:
qq=i.split() qq=i.split()
#print(qq[1:]) #print(qq[1:])
sum = 0 sum = 0
for i in qq[1:]: for i in qq[1:]:
sum = sum+int(i) sum = sum+int(i)
\ No newline at end of file fff=qq[0]+str(sum)+"\n"
ff.append(fff)
with open(r'c:\Users\Windows 10\Documents\lesson13-1\sales_list.txt',"w",encoding="utf-8")as file:
file.writelines(ff)
print("111")
\ 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