Commit 90e07dec by BellCodeEditor

save project

parent 9a581ef4
Showing with 14 additions and 14 deletions
# 英雄角色类 with open()as file:
class Hero(object): a=file.readline()
def __init__(self, name):
self.level = 1
self.hp = 250
self.attack = 40
self.name = name
def combat(): # 攻击
???
yase = Hero("垭瑟") final_sum=[]
houyi= Hero("后羿") for i in a:
yase.combat(houyi) data=i.split()
\ No newline at end of file sum=0
for sales in data[1:]
sum=sum+int(sales)
result = data[0]+str(sum)+'\n'
final_sum.append(result)
with open()as file:
file.writelines(final_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