Commit d96c2bc3 by BellCodeEditor

save project

parent f8aa9470
Showing with 8 additions and 5 deletions
class Hero:
def __init__(self,name,hp,attack):
self.level=1
self.hp=300
self.attack=20
yese=Hero()
print(yese.hp)
\ No newline at end of file
self.hp=hp
self.attack=attack
yese=Hero("亚瑟",300,20)
houyi=Hero("后羿",25,24)
print("亚瑟的血量是",yese.hp)
print("亚瑟的攻击力是",yese.attack)
print("后羿的攻击力是",houyi.attack)
\ 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