# 定义Student类
class Student:
def __init__(self, name, xuehao, phone):
self.name = name
self.xuehao = xuehao
self.phone = phone
self.__password = 123
def say_hello(self,):
print("你好,我是{n},密码是{b}".format(n=self.name,b=self.__password))
def say_phone(self,):
print("我的电话是{n}".format(n=self.phone))
def say_jiesao(self,):
print("我的名字是{n}".format(n=self.name), "我的电话是{m}".format(m=self.phone))
# 实例化
zhangsan = Student("zhangsan","01","123456")
# 属性
zhangsan.xuehao
# 调用方法
zhangsan.say_hello()
zhangsan.say_phone()
zhangsan.say_jiesao()