Commit 4cf21a11 by BellCodeEditor

save project

parent 4177d888
Showing with 10 additions and 7 deletions
class Hero: class Hero:
def __init__(hoyi): def __init__(self,name,hp,attack):
hoyi.laval=15 self.level = 1
hoyi.hp=1 self.name = name
hoyi.attack=2 self.hp = hp
hoyi=Hero() self.attack = attack
print(hoyi.hp) yase = Hero("垭瑟",300,20)
\ No newline at end of file houyi = Hero("后羿",250,23)
print("垭瑟的血量为:",yase.hp)
print("后羿的血量为:",houyi.hp)
\ 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