Commit 92dbd0e9 by BellCodeEditor

save project

parent 3ae0f8bb
Showing with 7 additions and 3 deletions
final_sum=[]
with open(r'c:\Users\EDZ\Desktop\sale.list.txt','r',encoding='utf-8') as file:
a=file.readlines()
for i in a:
......@@ -5,5 +6,8 @@ for i in a:
sum=0
for b in list[1:]:
sum+=int(b)
result=list[0]+str(sum)
print(result)
\ No newline at end of file
result=list[0]+str(sum)+'\n'
final_sum.append(result)
print(result)
with open(r'c:\Users\EDZ\Desktop\hello.txt.txt','w',encoding='utf-8') as file2:
file2.writelines(final_sum)
\ 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