Commit 6c15bcda by BellCodeEditor

save project

parent 5f396dd8
Showing with 8 additions and 5 deletions
class Hero:
def __inint__(self,name,hp,attack):
def __init__(self,name,hp,attack):
self.level = 1
self.name = name
self.hp = hp
self.attack = attack
libai = Hero("李白",300,50)
yase = Hero("亚瑟",400,60)
print(libai.hp)
print(tase.hp)
def upgrade():
yase.hp = yase.hp+100
yase.level = yase.level+1
yase.attack = yase.attack+50
libai = Hero("李白",200,30)
yase = Hero("亚瑟",250,20)
\ 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