Commit c1bcbf24 by BellCodeEditor

save project

parent ac795495
Showing with 23 additions and 3 deletions
...@@ -9,8 +9,8 @@ class Cat: ...@@ -9,8 +9,8 @@ class Cat:
def run(self): def run(self):
print("小猫飞快的跑起来") print("小猫飞快的跑起来")
def skill(): def skill(self,xx):
?? info="小猫抓住了"+str(xx)
print(info)
role = Cat() role = Cat()
role.skill("老鼠") role.skill("老鼠")
\ No newline at end of file
class Hero:
def __init__(self,name,hp,level,attack,speed):
self.name=name
self.hp=hp
self.level=level
self.attack=attack
self.speed=speed
def levelup(self):
self.hp=self.hp+9
self.attack=self.attack+34
self.speed=self.speed+30
self.level=self.level+20
def
susan=Hero("宿伞",0,3,50,50)
susan.levelup()
print(susan.speed)
\ 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