Commit 7571621c by BellCodeEditor

save project

parent 800cc921
Showing with 10 additions and 10 deletions
......@@ -20,20 +20,20 @@ class Hero: # 英雄类
info = info1+info2+info3
print(info)
exit()
print('')
class Player(Hero): # 玩家英雄
def __init__(self,name):
def __init__(self,name,level,hp):
super().__init__(name)
self.hp=200
self.level = 3
self.hp=hp
self.level = level
player = Player("后羿")
print("玩家的血量值为:",player.hp)
print("玩家的攻击力为:",player.level)
print("玩家的血量值为:",self.hp)
print("玩家的攻击力为:",self.level)
player=Player('后羿',999,45)
hoyi=Player('等级',5,55)
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