Commit b673daed by BellCodeEditor

save project

parent 85f5a760
Showing with 14 additions and 8 deletions
class Hero: class Hero:
def __init__(self): def __init__(self,name,hp,level,attack,speed):
self.hp=100 self.name=name
self.level=2 self.hp=hp
self.attack=60 self.level=level
self.speed=50 self.attack=attack
susan=Hero() self.speed=speed
print(susan.hp) susan=Hero("宿伞",0,3,50,50)
\ No newline at end of file def levelup():
susan.hp=susan.hp+9
susan.attack=susan.attack+34
susan.speed=susan.speed+30
susan.level=susan.level+20
levelup()
\ 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