Commit 16d64c2c by BellCodeEditor

save project

parent e9cf1c7f
Showing with 10 additions and 3 deletions
......@@ -19,6 +19,14 @@ class Hero(object):
info=info1+info2+info3
print(info)
exit()
class Player(Hero):
def __init__(self,name,k):
super().__init__(name)
self.hp=200
self.attack=50
self.k=k
print('成功创建'+self.name+"英雄属性为",self.k)
print('血量,攻击力,等级为',self.hp,self.attack,self.level)
yase = Hero("垭瑟")
houyi= Hero("后羿")
yase.combat(houyi)
\ No newline at end of file
houyi= Player("后羿",'射手')
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