Commit 6623488c by BellCodeEditor

save project

parent 568c326a
Showing with 9 additions and 6 deletions
class Hero:
def __init__(self):
self.level=1
self.Hp=300
self.attack=20
yase=Hero()
print(yase.level,yase.Hp,yase.attack)
def __init__(self,level,name,Hp,attack):
self.level=level
self.Hp=Hp
self.attack=attack
self.name=name
caozai=Hero(1,"曹仔",300,20)
houyi=Hero(1,"后羿",250,23)
print(caozai.level,caozai.Hp,caozai.attack)
print(houyi.level,houyi.Hp,houyi.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