Commit 0966c79f by BellCodeEditor

save project

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