Commit 1f4a7ae8 by BellCodeEditor

auto save

parent 1323b108
Showing with 12 additions and 5 deletions
file=open(r"c:\Users\Admin\Desktop\sales_list.txt","r",encoding="UTF-8")
a=file.readlines()
for i in a:
print(i)
\ No newline at end of file
g=[]
a=file.readlines()
for i in a:
data=i.split()
sum=0
for c in data[1:]:
sum=sum+int(c)
e=data[0]+str(sum)+"/n"
g.append(e)
with open(r"c:\Users\Admin\Desktop\sales_list.txt","r",encoding="UTF-8") as file:
file.writelines(g)
\ 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