Commit 0ddbd4c8 by BellCodeEditor

save project

parent 1a1bb2a4
Showing with 9 additions and 4 deletions
file1=open(r"C:\Users\Administrator\Desktop\.txt",'r',encoding='utf-8') with open(r"C:\Users\Administrator\Desktop\.txt",'r',encoding='utf-8')as file1:
w=file1.readlines() w=file1.readlines()
#print(w) #print(w)
mod=[]
for i in w: for i in w:
e=i.split() e=i.split()
v=0 v=0
for k in e[1:]: for k in e[1:]:
v=v+int(k) v=v+int(k)
u=e[0]+str(v) u=e[0]+str(v)+'\n'
print(u) mod.append(u)
print()
with open(r"C:\Users\Administrator\Desktop\.txt",'r',encoding='utf-8')as file1:
file1.writelines(mod)
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