From b44e647284f0b7837a6b63bfabd8b3b91dbc9ccc Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Sat, 9 Apr 2022 12:09:41 +0800 Subject: [PATCH] save project --- diy2.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/diy2.py b/diy2.py index 3d9188b..fed6040 100644 --- a/diy2.py +++ b/diy2.py @@ -23,12 +23,11 @@ class Hero: # 英雄类 class Player(Hero): # 玩家英雄 - def __init__(self,name): - pass + def __init__(self,name,hero_type): super ().__init__(name) self.hp = 300 self.attack = 200 - + self.hero_type=hero_type player = Player("后羿") print("玩家的血量值为:",player.hp) print("玩家的攻击力为:",player.attack) -- libgit2 0.25.0