类与self

class Student:
    def __init__(self, n, id):
        self.name = n
        self.id = id
        self.__age = 18

    def say_hello(self):
        print(f'我是{self.name},今年{self.__age}岁')

    def set_age(self, age):
        if 12 < age < 20:
            self.__age = age
        else:
            print('年龄输入错误')

# class MiShu:
#     def say_hellow(self):
#         print('二狗你好')
#
#
# if __name__ == '__main__':
#     a = MiShu()
#     a.say_hellow()
from student import Student

s1 = Student('张三', 123)
s2 = Student('李四', 123)

s1.set_age(18)
s2.set_age(17)

s1.say_hello()
s2.say_hello()