Commit 0a030acb by BellCodeEditor

save project

parent be4bd8da
Showing with 3 additions and 2 deletions
class Hero: # 英雄类
def __init__(self, name): # 实例属性
print('角色后裔创建成功,英雄类型为:射手')
print('当前等级,血量,攻击力分别为:1 200 40')
self.name = name
self.level = 1
self.hp = 250
......@@ -30,5 +32,4 @@ class Player(Hero): # 玩家英雄
player = Player("后羿")
print("玩家的血量值为:",player.hp)
print("玩家的攻击力为:",player.attack)
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