Commit 90a64f0c by BellCodeEditor

save project

parent f98519fd
Showing with 7 additions and 7 deletions
class Hore: class Hore:
def __init__ (self): def __init__ (self,name,HP,attack):
self.level=1 self.level=1
self.HP=300 self.HP=HP
self.attack=20 self.attack=attack
yase = Hore() yase = Hore("亚瑟",300,20)
print("亚瑟的血量",yase.HP) houyi = Hore("后羿",250,25)
print("亚瑟的攻击力",yase.attack) print("后羿攻击力",houyi.attack)
\ No newline at end of file print("亚瑟攻击力",yase.attack)
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