Commit 8807a180 by BellCodeEditor

save project

parent 0ed26cbe
Showing with 7 additions and 3 deletions
with open(r"c:\Users\EDZ\Documents\lesson13-1\sales_list.txt","r",encoding="utf-8")as file1:
a=file1.readlines()
b=[]
#print(a)
for i in a:
i=i.split()
......@@ -8,5 +9,8 @@ for i in a:
sum=0
for sales in i[1:]:
sum=sum+int(sales)
a=i[0]+str(sum)
print(a)
\ No newline at end of file
a=i[0]+str(sum)+'\n'
b.append(a)
print(a)
with open(r"c:\Users\EDZ\Documents\lesson13-1\sales_list.txt","a",encoding="utf-8")as file1:
\ 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