Commit 0966c79f by BellCodeEditor

save project

parent b3c8225e
Showing with 10 additions and 8 deletions
class hero:
def __init__(dog):
dog.level=9000
dog.hp=234
dog.attack=200
yaze=hero()
print("yaze的攻击力:",yaze.attack)
\ No newline at end of file
class Hero:
def __init__(dog,name,hp,attack):
dog.level=900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
dog.hp=hp
dog.name=name
dog.attack=attack
yaze=Hero("鸭子",300,234)
qianyi=Hero("前蚁",500,1)
print("yaze的攻击力:",yaze.attack)
print("qianyi的攻击力:",qianyi.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