Commit 2d8256dc by BellCodeEditor

save project

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