Commit 23dabfab by BellCodeEditor

auto save

parent d750beab
Showing with 12 additions and 0 deletions
with open(r'C:\Users\23636\Desktop\score.txt','w',encoding='utf-8')as file1:
file1.write('罗恩 23 35 44\n哈利 60 77 68 88 90\n赫敏 97 99 89 91 95 90\n马尔福 100 85 90')
with open(r'C:\Users\23636\Desktop\score.txt','r',encoding='utf-8')as file1:
file1_lines=file1.readlines()
final_score=[]
for i in file1_lines:
data=i.split()
sum=0
for score in data[1:]:
sum=sum+int(score)
result=data[0]+str(sum)
fina
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