(校验手机号码运营商)一个简单的小python case
def number_test():while True:
number = input('Please enter your phone number:')
CN_mobile = [134, 135, 136, 137, 138, 139, 150, 151, 152,
157, 158, 159, 182, 183, 184, 187, 188, 147, 178, 1705]
CN_union =
CN_dianxin =
first_three = int(number)
first_four = int(number)
if len(number) == 11:
if first_three in CN_mobile or first_four in CN_mobile:
print('Operator: China Mobile!')
break
elif first_three in CN_union or first_four in CN_union:
print('Operator: China Union!')
break
elif first_three in CN_dianxin or first_four in CN_dianxin:
print('Operator: China Dianxin!')
break
else:
print('invalid input number!')
else:
print('invalid numbers,You number should be 11th')
number_test()
现在存在携号转网,这样会有数据不准 携号转网
我就是电信转了移动,打电话还显示电信的 基本上可以了,毕竟携号转网不好弄,现在手机都识别不出来 携号转网的号码需要运营商放出来才行,但这涉嫌暴露用户隐私,应该是不会公布了{:300_966:} 我的联通都携号转网到移动了 萬一輸入的是11 長度的字符串呢?應該把無效判斷提到前面 China Dianxin...
{:301_978:} 识别手机号前三位?
页:
[1]
2