Commit 969d3e63 by BellCodeEditor

save project

parent 70850cf8
Showing with 15 additions and 0 deletions
class Hero:
def __init__(self, name, hp, attack):
self.level = 1
self.name = name
self.hp = hp
self.attack = attack
yase = Hero("亚瑟", 500, 54)
houyi = Hero("后羿", 420, 89)
print("亚瑟的姓名:", yase.name)
print("亚瑟的血量:", yase.hp)
print("亚瑟的攻击力:", yase.attack)
print("后羿的姓名:", houyi.name)
print("后羿的血量:", houyi.hp)
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