Commit 7846b6b5 by BellCodeEditor

save project

parent fa51eed0
Showing with 8 additions and 2 deletions
with open(r"c:\Users\86152\Desktop\code\zop.txt","r",encoding="utf-8") as file1 : with open(r"c:\Users\86152\Desktop\code\zop.txt","r",encoding="utf-8") as file1 :
a=file1.readlines() a=file1.readlines()
cb=[]
for i in a: for i in a:
y=i.split() y=i.split()
j=0 j=0
for k in y[1:]: for k in y[1:]:
j=j+int(k) j=j+int(k)
gh=y[0]+str(j) gh=y[0]+":"+str(j)+"\n"
print(gh) cb.append(gh)
with open(r"c:\Users\86152\Desktop\code\1.txt","w",encoding="utf-8") as file1 :
file1.writelines(cb)
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