Commit 108c2762 by BellCodeEditor

save project

parent 27bf5652
Showing with 8 additions and 0 deletions
with open(r'c:\Users\admin\Desktop\sale.txt','r',encoding='utf-8')as file: with open(r'c:\Users\admin\Desktop\sale.txt','r',encoding='utf-8')as file:
a=file.readlines() a=file.readlines()
#print(a) #print(a)
c=[]
for i in a: for i in a:
deta=i.split() deta=i.split()
sum=0 sum=0
...@@ -8,6 +9,13 @@ with open(r'c:\Users\admin\Desktop\sale.txt','r',encoding='utf-8')as file: ...@@ -8,6 +9,13 @@ with open(r'c:\Users\admin\Desktop\sale.txt','r',encoding='utf-8')as file:
sum=sum+int(sale) sum=sum+int(sale)
b=str(sum) b=str(sum)
print(deta[0]+b) print(deta[0]+b)
c.append(deta[0]+b+"\n")
with open(r'c:\Users\admin\Desktop\sale.txt','w',encoding='utf-8')as file:
file.writelines(c)
......
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