Commit f6d14f67 by BellCodeEditor

auto save

parent f47689a4
Showing with 17 additions and 0 deletions
class Hero:#英雄类
def __init__(self):
self.level=1 #类属性
self.hp=1000
self.df=300
self.attack=50
houyi=Hero() #实例化对象
print(houyi.hp)
class Shot:
def __init__(self,name,age,level,skill):#形参
self.name=name
self.age=age
self.level=level
self.skill=skill
hz=Shot('黄忠',50,20,'百步穿杨')
ssx=Shot('孙尚香',20,10,'火炮')
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