📜  python 随机电话号码 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:12.327000             🧑  作者: Mango

代码示例1
import random

def phn():
    n = '0000000000'
    while '9' in n[3:6] or n[3:6]=='000' or n[6]==n[7]==n[8]==n[9]:
        n = str(random.randint(10**9, 10**10-1))
    return n[:3] + '-' + n[3:6] + '-' + n[6:]