Commit 28ee19f5 by BellCodeEditor

auto save

parent 06c1c781
Showing with 1429 additions and 2 deletions
with open(r'C:\Users\Administrator\Desktop\sales_list.txt','r',encoding='utf-8')as file:
a=file.readlines()
#print(a)
q=[]
for i in a:
data=i.split()
#print(data[1:])
s=0
for sales in data[1:]:
s=s+int(sales)
a=data[0]+str(s)
print(a)
a=data[0]+str(s)+'\n'
q.append(a)
with open(r'C:\Users\Administrator\Desktop\x.txt','a',encoding='utf-8')as file:
file.writelines(q)
\
\ 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