Commit e8eeebd2 by BellCodeEditor

auto save

parent 94a409f7
Showing with 17 additions and 3 deletions
with open (r"C:\Users\86159\Desktop\sales_list.txt","r",encoding="utf-8") as a:
b=a.read()
print(b)
with open (r"C:\Users\86159\Desktop\sales_list.txt","r",encoding="utf-8") as file:
a=file.readlines()
# print(a)
list_new=[]
for i in a:
data=i.split()
# print(data[1:])
sum=0
for v in data[1:]:
sum+=int(v)
s=data[0]+str(sum)+"\n"
# print(s)
list_new.append(s)
with open (r"C:\Users\86159\Desktop\new_mingx.txt","a",encoding="utf-8") as file:
file.writelines(list_new)
\ 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