Commit 92f4d88e by BellCodeEditor

save project

parent c55b95b6
Showing with 10 additions and 6 deletions
class Hero(): class Hero():
del __call__ (yase) def __init__(self,name,hp,attack,level):
yase.hp=300 self.name = name
yase.attack=20 self.hp = hp
yase.level=1 self.attack = attack
sat=yase() self.level = level
print(sat.hp) yase=Hero("亚瑟",300,20,14)
houyi=Hero("后羿",260,24,14)
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