Commit 6623488c by BellCodeEditor

save project

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