Commit 90e07dec by BellCodeEditor

save project

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