Commit 0fd690b4 by BellCodeEditor

save project

parent d4c7214e
Showing with 6 additions and 3 deletions
reh=[]
with open(r'c:\Users\饮水思源\Desktop\qw','r',encoding='utf-8') as li: with open(r'c:\Users\饮水思源\Desktop\qw','r',encoding='utf-8') as li:
a=li.readlines() a=li.readlines()
for i in a: for i in a:
...@@ -5,5 +6,7 @@ with open(r'c:\Users\饮水思源\Desktop\qw','r',encoding='utf-8') as li: ...@@ -5,5 +6,7 @@ with open(r'c:\Users\饮水思源\Desktop\qw','r',encoding='utf-8') as li:
sum=0 sum=0
for j in data[1:]: for j in data[1:]:
sum+=int(j) sum+=int(j)
huu=data[0]+str(sum) huu=data[0]+str(sum)+'\n'
print(huu) reh.append(huu)
\ No newline at end of file with open(r'c:\Users\饮水思源\Desktop\oow','a',encoding='utf-8') as ll:
ll.writelines(reh)
\ 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