Commit 2d8256dc by BellCodeEditor

save project

parent b19bec26
Showing with 10 additions and 8 deletions
class hero:
def __init__(self):
def __init__(selfname,hp,attack):
self.level=1
self.hp=300
self.attack=20
self.name=name
self.hp=hp
self.attack=attack
yase=hero()
print("yase的等级为:",level=1)
print("yase的血量值为:",yese.hp)
print("yase的攻击力为:",yese.attack)
\ No newline at end of file
yase=hero("亚瑟",300,20)
houyi=hero("后羿",240,23)
print("亚瑟的血量值为:",yese.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