实例化过程:
class luffy_stu: def __init__(self,name,age,sex): self.name = name self.age = age self.sex = sex def eat(self): pass if __name__=="__main__": stu1 = luffy_stu('bao',21,'male') #实例化过程: #1. 是先产生一个stu1对象, #2. luffy_stu.__init__('stu1','bao',21,'male')再将stu1对象传入__init__构造函数中实例化对象.