Commit 32751d36 by BellCodeEditor

auto save

parent 3955bb71
Showing with 6 additions and 3 deletions
......@@ -7,5 +7,8 @@ with open(r'C:\Users\XMBC\Documents\lesson13-1\sales_list.txt',mode='r',encoding
sum=0
for c in b[1:]:
sum=sum+int(c)
d=b[0]+str(sum)
print(d)
\ No newline at end of file
d=b[0]+str(sum)+'\n'
print(d)
with open(r'c:\Users\XMBC\Desktop\2.txt',mode='w',encoding='utf-8') as file:
file.writelines(d)
\ 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