Commit 925b93ad by BellCodeEditor

save project

parent 7f3d2371
Showing with 2 additions and 14 deletions
with open(r'C:\Users\Administrator\Desktop\',encoding='utf-8') as file: print('hello')
a=file.readlines() \ No newline at end of file
#print(a)
final_sum=[]
for i in a:
data=i.split()
sum=0
for sales in data[1:]:
sum=sum+int(sales)
result = data[0]+str(sum)+'\n'
final_sum.append(result)
with open(r'C:\Users\Administrator\Desktop\new_sales_list.txt','a',enconding='utf-8') as file:
file.writelines(final_sum)
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