Commit 7b37d60f by BellCodeEditor

save project

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