class BoyFriend():
#类属性
height=175
weight=130
money="500万"
#类函数/类方法
def print_msg(self):#固定的占坑符号 类里面的方法 都必须带self这个参数
print(self)
def cooking(self):
print("男盆友要会做饭")
def earn(self):
print("会挣钱")
#实例/对象 实例具有类中所有的属性和方法的使用权限
bf=BoyFriend()
#实例直接引用类的属性
bf.height #出来的是175
#实例直接引用类的方法
bf.print_msg() #出来的就是实例本身,与print(bf)打印出的效果相同