Commit 6c15bcda by BellCodeEditor

save project

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