資源簡介
python 手機號碼運營商查詢
代碼片段和文件信息
import?re
def?phone():
?n?=?input(“請輸入一個手機號:“)
?if?re.match(r‘1[34578]\d{9}‘n):
??print(“您輸入的的手機號碼是:\n“n)
??#中國聯通:
??#?130,131,132,155,156,185,186,145,176
??if?re.match(r‘13[012]\d{8}‘n)?or?\
???re.match(r“15[56]\d{8}“n)?or?\
???re.match(r“18[56]“n)?or?\
???re.match(r“145\d{8}“n)?or?\
???re.match(r“176\d{8}“n):
???print(“該號碼屬于:中國聯通“)
??#中國移動
??#?134?135??136?137?138?13
- 上一篇:python 計算器
- 下一篇:python 實現電子計算機
評論
共有 條評論