Commit b3042f5b by BellCodeEditor

save project

parent 3ad4ea2f
Showing with 9 additions and 5 deletions
class hero:
def __init__(self):
def __init__(self,name,age,level,hp,attack):
self.name=name
self.age=age
self.level=1
self.hp=300
self.attack=20
SB=hero()
print(SB.level,SB.hp,SB.attack)
self.hp=hp
self.attack=attack
ys=hero("垭瑟",30,1000,60)
he=hero("后羿",40,999,149)
print(ys.name,ys.age,ys.level,ys.hp,ys.attack)
print(he.name,he.age,he.level,he.hp,he.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