Commit 1ec8a8c8 by BellCodeEditor

save project

parent a08662f6
Showing with 16 additions and 0 deletions
with open("C:\\Users\\Administrator\\Desktop\\sales_list.txt","r",encoding="utf-8")as file:
a=file.readlines()
abcd=[]
for i in a:
data=i.split()
sum=0
for salse in data[1:]:
sum=sum+int(salse)
w=data[0]+str(sum)
abcd.append(w)
with open("C:\\Users\\Administrator\\Desktop\\sales_list.txt","w",encoding="utf-8")as file:
file.writelines(abcd)
\ 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