Commit f3d66759 by BellCodeEditor

save project

parent 88ff3e3e
Showing with 18 additions and 7 deletions
class hero: class hero:
def __init__(self): def __init__(self,level,hp,attack):
self.level=1 self.level=level
self.hp=300 self.hp=hp
self.attack=20 self.attack=attack
lixin=hero(15,500,100)
print(lixin.level)
print(lixin.hp)
print(lixin.attack)
lixing=hero() suenmukong=hero(15,400,200)
print(lixing.hp) print(suenmukong.level)
\ No newline at end of file print(suenmukong.hp)
print(suenmukong.attack)
kai=hero(15,600,150)
print(kai.level)
print(kai.hp)
print(kai.attack)
\ No newline at end of file
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