class Person(object):# name = ""# age =0# height = 0# weight = 0def run(self):print("run")def eat(self,food):print("eat"+food)def __init__(self,name,age,height,weight):# print(name,age,weight,height)print("这里是init")self.name = nameself.height = heightself.age =ageself.weight = weightpass'''构造函数:__init__() 在使用类创建对象的时候自动调用注意:如果不显示的写出构造函数,默认会自动添加一个空的函数
'''
per = Person("韩梅梅",20,170,55)print(per.name,per.weight)per2 = Person("lilei",21,180,90)print(per2.name,per2.weight)