Commit e2d4bf70 by BellCodeEditor

save project

parent d6c81a0f
Showing with 12 additions and 0 deletions
class Hero:
def __init__(self,name,hp,attack):
self.hp=hp
self.level=1
self.attack=attack
self.name=name
yese=Hero("亚瑟",300,20)
print(yese.hp)
houyi=Hero("后羿",240,25)
print(houyi.hp)
yese.hp=300+yese.level*50
yese.attack=20+yese.attack*3
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