Commit a1f5bdfc by BellCodeEditor

save project

parent 0ff19ef5
Showing with 12 additions and 2 deletions
class Hero:
def __init__(self,name,hp,attack):
self.level=1
self.attack=attack
self.hp=hp
self.level=1
yase=Hero()
self.name=name
yase=Hero("亚瑟",600,50)
houyi=Hero("后羿",450,80)
print(yase.hp)
print(houyi.hp)
def upgrade():
yase.hp=yase.hp+80
yase.attack=yase.attack+20
yase.level=yase.level+1
upgrade()
......
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