Commit 143fbd59 by BellCodeEditor

save project

parent 173b78fd
Showing with 10 additions and 7 deletions
class Hero:
def __init__(selt):
selt.level="等级:1"
selt.hp="血量:300"
selt.attack="攻击:20"
yase=Hero()
print(yase.level)
\ No newline at end of file
def __init__(self,name,hp,attack):
self.level=1
self.name=name
self.hp=hp
self.attack=attack
yase=Hero("亚瑟",300,20)
hoyi=hero("后裔",250,23)
print(yase.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