Commit 1a0779c6 by BellCodeEditor

save project

parent 37c5806e
Showing with 9 additions and 1 deletions
......@@ -19,7 +19,14 @@ class Hero(object):
info = info_1+info_2+info_3
print(into)
exit()
class Player(Hero):
def__init__(self,name,hero_type):
super(Player,self).__init__(name)
self.hp = 160
self.attack = 60
self.hero_type = hero_type
print(self.name+'角色创建成功'+'英雄属性是:'+self.hero_type)
print('等级,血量,攻击力分别是',self.level,self.hp,self.attack)
yase = Hero("垭瑟")
houyi= Hero("后羿")
yase.combat(houyi)
\ 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