Commit 1f46cd0d by BellCodeEditor

save project

parent 61a2a3ba
Showing with 89 additions and 6 deletions
class hero
class Hero:
def __init__(self):
self.level=1
self.hp=300
self.attack=20
self.name=name
self.hp=hp
self.attack=attack
yase=Hero("亚涩",300,20)
houyi=Hero("后一",240,23)
k=hero("凯",400,18)
print('yase的血量值:',yase.hp)
print('houyi的血量值:',houyi.hp)
print('k的血量值:',k.hp)
yase=Hero()
print('yase的血量值:',self.hp)
print('yase的攻击力:',self.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