Commit b300052d by BellCodeEditor

save project

parent f48e76f6
Showing with 9 additions and 3 deletions
......@@ -17,12 +17,18 @@
# print(a)
with open(r'c:\Users\EDY\Documents\lesson13_2\sales_list.txt','r',encoding='utf-8') as filel:
b=filel.readlines()
e=[]
for i in b:
s=i.split()
sum=0
for m in s[1:]:
sum=sum+int(m)
n=s[0]+str(sum)
print(n)
n=s[0]+str(sum)+"/n"
e.append(n)
with open(r'C:\Users\EDY\Desktop\test.txt','a',encoding='utf-8') as filel:
filel.writelines(e)
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