python(生成类对象__init__)

# Author: Sooele
##定义类   可以当作模板
class Teacher:
    def __init__(self,name,age,sex):
        self.name = name
        self.age = age
        self.sex = sex
    def course(self,name):
        print(f'我是{name}')
# Teacher()
####传参数 name,age,sex
aa = Teacher('aa',18,'男')
bb = Teacher('bb',66,'s男')

print(aa.name)
print(bb.name)


####传参外的参数可以修改
aa.name = 'cc'
print(aa.name)

####
aa.course('dd')