Commit 759c328e by BellCodeEditor

save project

parent a18e4a4c
Showing with 8 additions and 8 deletions
class hero: class hero:
def __init__(self): def __init__(self,name,hp,attack):
self.level=1 self.level=1
self.hp=300 self.hp=hp
self.attack=20 self.attack=attack
fwukong=Hero() self.name=name
print(fwukong.hp) houyi=hero('houyi',300,20)
print(fwukong.leve1) kai=hero('kai',30,20000000000000000000000000000000000000000000)
print(fwukong.attack) print(kai.hp)
\ No newline at end of file print(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