Commit b225c7b6 by BellCodeEditor

save project

parent f47689a4
Showing with 13 additions and 0 deletions
#创建一个英雄类
class Hero:
def __init__(self):
self.level=1 #等级
self.hp=300 #血量
self.attack=25 #攻击力
#实例化对象
yase=Hero()
houyi=Hero()
print('亚瑟的血量是',yase.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