Commit 24344367 by BellCodeEditor

save project

parent a221b1c5
Showing with 9 additions and 5 deletions
with open(r"c:\Users\LL\Documents\lesson13-1\sales_list.txt",'r',encoding='utf-8') as fiel1:
a=fiel1.readlines()
sum=0
with open(r"C:\Users\LL\Desktop\12.monkey",'r',encoding='utf-8') as fiel1:
a=fiel1.readlines()
final_sun=[]
for i in a:
data=i.split()
for sales in data[1:]:
sum=sum+int(sales)
result=data[0]+str[sum]
print(result)
result=data[0]+str[sum]+'\n'
final_sun.append(result)
with open(r"c:\Users\LL\Documents\lesson13_2\sales_list.txt",'a',encoding='utf-8') as fiel1:
fiel1.writelines(final_sun)
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