Commit e9ba5e98 by BellCodeEditor

auto save

parent f47689a4
Showing with 13 additions and 0 deletions
class Hero:
def __init__(self):
self.level = 1
self.hp = 300
self.attack = 200
yase = Hero() # 实例化对象yase
# 查看英雄的属性
print('英雄等级:%d'%yase.level)
print('英雄血量:%d'%yase.hp)
print('英雄攻击力:%d'%yase.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