Commit 7b37d60f by BellCodeEditor

save project

parent 2542d750
Showing with 9 additions and 5 deletions
class Hero: class Hero:
def __init__(solf): def __init__(self,name,hp,attack):
solf.level=1 self.level=1
solf.hp=300 self.hp=hp
solf.attack=40 self.attack=attack
yese=Hero() self.name=name
yese=Hero('亚瑟',300,20)
hoyi=Hero('后羿',240,23)
print(yese.hp) print(yese.hp)
print(hoyi.hp)
\ 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