Commit 8aa06210 by BellCodeEditor

save project

parent 14217e5a
Showing with 7 additions and 15 deletions
with open(r'C:\Users\广场一号\Desktop\ssles_list.txt','r',encoding='utf-8')as file:
a=file.readlines()
final_sum=[]
for i in a:
data = i.split()
sum=0
for ssles in data[1:]:
sum=sum+int(ssles)
z = data[0]+str(sum)+'\n'
final_sum.append(z)
with open (r'C:\Users\广场一号\Desktop\ssles_list.txt','a',encoding='utf-8')as file:
file.writelines(final_sum)
\ No newline at end of file
cless he
\ No newline at end of file
class hero:
def __init__(self):
self.hp = 12000
self.level = 1
self.attack=20
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