Commit 4ae621ee by BellCodeEditor

save project

parent e03b260b
Showing with 16 additions and 0 deletions
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
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