class student(object):
    #__init__(self, name, age):
    # 通过这个方法我们可以为学生绑定name和age两个属性
    def __init__(self , name, age):
        self.name = name
        self.age = age

    def study(self, course_name):
        print('%s正在学习%s.' % (self.name, course_name))

    #PEP 8要求标识符的名字用全小写多个单词用下划线连接
    #但是部分程序员和公司更倾向于使用驼峰命名法（驼峰标识）

    def wathch_movie(self):
        if self.age < 18:
            print('%s只能观看动画片.' % self.name)
        else:
            print('%s正在观看刺激电影' % self.name)


def main():
    #创建学生对象并指定姓名和年龄
    stu1 = student('lily' , 20)
    stu1.study('Python程序设计')
    stu1.wathch_movie()
    stu2 = student('lucy', 13)
    stu2.study('法语')
    stu2.wathch_movie()

if __name__ == '__main__':
    main()
210c9b9e9a3aab2fee16827c7b69f8541196882b
class student(object):

    def __init__(self, name, age):
        self.name = name
        self.age = age

    def study(self, course_name):
        print('%s正在学习%s.' % (self.name, course_name))
    <mask token>


<mask token>

class student(object):

    def __init__(self, name, age):
        self.name = name
        self.age = age

    def study(self, course_name):
        print('%s正在学习%s.' % (self.name, course_name))

    def wathch_movie(self):
        if self.age < 18:
            print('%s只能观看动画片.' % self.name)
        else:
            print('%s正在观看刺激电影' % self.name)


<mask token>

class student(object):

    def __init__(self, name, age):
        self.name = name
        self.age = age

    def study(self, course_name):
        print('%s正在学习%s.' % (self.name, course_name))

    def wathch_movie(self):
        if self.age < 18:
            print('%s只能观看动画片.' % self.name)
        else:
            print('%s正在观看刺激电影' % self.name)


def main():
    stu1 = student('lily', 20)
    stu1.study('Python程序设计')
    stu1.wathch_movie()
    stu2 = student('lucy', 13)
    stu2.study('法语')
    stu2.wathch_movie()


<mask token>

class student(object):

    def __init__(self, name, age):
        self.name = name
        self.age = age

    def study(self, course_name):
        print('%s正在学习%s.' % (self.name, course_name))

    def wathch_movie(self):
        if self.age < 18:
            print('%s只能观看动画片.' % self.name)
        else:
            print('%s正在观看刺激电影' % self.name)


def main():
    stu1 = student('lily', 20)
    stu1.study('Python程序设计')
    stu1.wathch_movie()
    stu2 = student('lucy', 13)
    stu2.study('法语')
    stu2.wathch_movie()


if __name__ == '__main__':
    main()

class student(object):
    #__init__(self, name, age):
    # 通过这个方法我们可以为学生绑定name和age两个属性
    def __init__(self , name, age):
        self.name = name
        self.age = age

    def study(self, course_name):
        print('%s正在学习%s.' % (self.name, course_name))

    #PEP 8要求标识符的名字用全小写多个单词用下划线连接
    #但是部分程序员和公司更倾向于使用驼峰命名法（驼峰标识）

    def wathch_movie(self):
        if self.age < 18:
            print('%s只能观看动画片.' % self.name)
        else:
            print('%s正在观看刺激电影' % self.name)


def main():
    #创建学生对象并指定姓名和年龄
    stu1 = student('lily' , 20)
    stu1.study('Python程序设计')
    stu1.wathch_movie()
    stu2 = student('lucy', 13)
    stu2.study('法语')
    stu2.wathch_movie()

if __name__ == '__main__':
    main()