Commit 60b62ae7 by BellCodeEditor

auto save

parent ffa07797
Showing with 22 additions and 2 deletions
...@@ -9,8 +9,8 @@ class Cat: ...@@ -9,8 +9,8 @@ class Cat:
def run(self): def run(self):
print("小猫飞快的跑起来") print("小猫飞快的跑起来")
def skill(self,y): def skill():
print("小猫捉住了"+y) ??
role = Cat() role = Cat()
role.skill("老鼠") role.skill("老鼠")
\ No newline at end of file
class Hero:
def __init__(self,name):
self.hp=300
self.level=1
self.attack=40
self.name=name
class Player(Hero):
def __init__(self,name):
self.hp=200
self.level=1
self.attack=50
self.name=name
player=Player('后羿')
print(player.hp)
print(player.attack)
\ No newline at end of file
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