Commit 682db8c2 by BellCodeEditor

save project

parent d9fd6b1f
Showing with 8 additions and 8 deletions
class Hero: class Hero:
def __init__(self,name,hp,attack): def __init__(self,name,hp,attack):
self.level=1 self.level=1
self.name=name self.level=self.level+1
self.hp=hp self.hp=self.hp+50
self.attack=attack self.attack=attack+4
yase=Hero('yase',300,20) houyi=Hero('houyi',240,23)
hy=Hero('hy',250,23) houyi.upgrade()
k=Hero('K',5600,199) print("等级为:",240,23)
print(yase.attack) print("血量为:")
print(hy.attack)
print(k.attack) print(k.attack)
\ No newline at end of file
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