Commit b1e57551 by BellCodeEditor

save project

parent 66936a2c
Showing with 12 additions and 5 deletions
class hero:
def __init__(slef,hp,attack):
def __init__(slef,name,hp,attack):
slef.level = 1
slef.name = name
slef.hp = hp
slef.attack = attack
yase = hero(1000,20)
yase = hero("亚瑟",1000,20)
def upgrade():
yase.level = yase.level + 1
yase.hp = yase.hp +50
yase.attack = yase.attack + 4
print(yase.hp)
houyi = hero(500,25)
print(houyi.hp)
\ No newline at end of file
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