这是一个可以识别手机号码属于联通,电信或移动厂家的程序,你输入你的电话号码,这段程序就可以自动识别你的电话号码是属于那个厂家,或者是错误号码。(这个不能识别座机号或短号)
CN_mobile = [134,135,136,137,138,139,150,151,152,157,158,159,182,183,184,187,188,147,178,1705]
CN_union = [130,131,132,155,156,185,186,145,176,1709]
CN_telecom = [133,153,180,181,177,1700]
def test_iphone_number():
numbers = input("Enter you number:")
if len(numbers)==11:
if int(numbers[:3]) in CN_mobile or int(numbers[:4]) in CN_mobile:
print('Operator : Chain Mobile !')
test_iphone_number()
elif int(numbers[:3]) in CN_union or int(numbers[:4]) in CN_union:
print('Operator : Chain Union !')
test_iphone_number()
elif int(numbers[:3]) in CN_telecom or int(numbers[:4]) in CN_telecom:
print('Operator : Chain Telecom !')
test_iphone_number()
else:
print(numbers[:4])
print('No such a operator')
else:
print("Invaild length,your number should be in 11 digits")
test_iphone_number()
test_iphone_number()