Commit 143fbd59 by BellCodeEditor

save project

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