Commit d5833b0b by BellCodeEditor

save project

parent f3301266
Showing with 9 additions and 7 deletions
class Heor: class Heor:
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
yase=Heor() self.name=name
print(yase.hp) yase=Heor("亚瑟",300,20)
print(yase.attack) houyi=Heor("后羿",250,23)
\ No newline at end of file print("亚瑟的血量",yase.hp)
print("后羿的血量",houyi.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