Commit 31a9a803 by BellCodeEditor

save project

parent 03f7c5f0
Showing with 6 additions and 6 deletions
class Hero: class Hero:
def __init__(self): def __init__(self):
self.hp=300 self.hp=500
self.level=1 self.level=1
self.attack=20 self.attack=50
jinan=Hero() zhuoxing=Hero()
print("jinan的血量值为:",jinan.hp) print("zhuoxing的血量值为:",zhuoxing.hp)
print("jinan的攻击力为:",jinan.attack) print("zhuoxing的攻击力为:",zhuoxing.attack)
print("jinan的等级为:",jinan.level) print("zhuoxing的等级为:",zhuoxing.level)
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