Commit e0db3c38 by BellCodeEditor

auto save

parent 68927860
Showing with 3 additions and 3 deletions
class Hero: class Hero:
def __init__(self,name,hp,attack): def __init__(self,name,hp,attack):
level=1 self.level=1
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
yase=Hero("亚瑟",500,7) yase=Hero("亚瑟",500,7)
def upgrabe() def upgrade():
yase.level+=1 yase.level+=1
yase.hp+=50 yase.hp+=50
yase.attack+=5 yase.attack+=5
upgrabe() upgrade()
print(yase.hp) print(yase.hp)
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