Commit 32b3eb4c by BellCodeEditor

save project

parent 2f176a3f
Showing with 8 additions and 4 deletions
class Hero: class Hero:
def __init__(self): def __init__(self,name,HP,attack):
self.HP=5000
self.level=1 self.level=1
self.attack=100 self.name=name
kai=Hero() self.HP=HP
self.attack=attack
kai=Hero('凯',5000,100)
jialuo=Hero('伽罗',4000,200)
print(kai.HP) print(kai.HP)
print(jialuo.HP)
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