Commit 66e73e90 by BellCodeEditor

auto save

parent 6e0dacea
Showing with 15 additions and 3 deletions
class Hero: class Hero:
def __init__(self): def __init__(self,name,hp,attack):
self.level = 1 self.level = 1
self self.name=name
\ No newline at end of file self.hp=hp
self.attack=attack
houyi=Hero('后羿',1234567890,9876543210)
yase=Hero('垭瑟',1029384756,1092837465)
def upgrade():
yase.level = yase.level+1
yase.hp=yase.hp+10000
yase.attack=yase.attack+100000
upgrade()
upgrade()
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