Commit 4f261922 by BellCodeEditor

save project

parent 4a459be1
Showing with 14 additions and 7 deletions
a= open(r"C:\Users\Lenovo\Desktop\yty\yty.txt",'r',encoding='utf-8') with open(r"C:\Users\Lenovo\Desktop\yty\yty.txt",'r',encoding='utf-8')as file:
b=a.readlines() a=file.readlines()
print(b) file_sum=[]
for i in b: for i in a:
c=i.split() data=i.split()
print(c[0]) sum=0
\ No newline at end of file for s in data[1:]:
sum=sum+int(s)
y=data[0]+str(sum)
print(y)
file_sum.append(y)
with open(r"C:\Users\Lenovo\Desktop\yty\yty.txt",'r',encoding='utf-8')as file:
file.writelines(file_sum)
\ 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