class Phone:
# 设计私有成员变量
__is_5g_enable = True # 5G状态
# 私有成员方法
def __check_5G(self):
if self.__is_5g_enable == True:
print("5G开启")
else:
print("5G关闭,使用4G网络")
# 提供公开成员方法
def call_by_5G(self):
self.__check_5G()
print("正在通话中")
phone = Phone()
phone.call_by_5G()