Commit a4f9a63c by BellCodeEditor

auto save

parent fedd481b
Showing with 21 additions and 2 deletions
...@@ -13,4 +13,24 @@ class Cat: ...@@ -13,4 +13,24 @@ class Cat:
print('小猫翻滚720,快速冲刺20cm') print('小猫翻滚720,快速冲刺20cm')
print(food+'没了') print(food+'没了')
role = Cat() role = Cat()
role.skill("老鼠") role.skill("老鼠")
\ No newline at end of file
class Hero():
def __init__(self,name):
self.level = 1
self.name = name
self.hp = 250
self.attack = 50
class Player(Hero):
def __init__(self,name):
self.level = 1
self.name = name
self.hp = 200
self.attack = 50
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