美文网首页
Python生成随机电话号码

Python生成随机电话号码

作者: wikizero | 来源:发表于2017-07-25 22:07 被阅读0次
def get_phone_number():
        pre_lst = ["130", "131", "132", "133", "134", "135", "136", "137", "138", "139", "147", "150", 
                   "151", "152", "153", "155", "156", "157", "158", "159", "186", "187", "188"]
    return random.choice(pre_lst) + ''.join(random.sample(digits, 8))


print get_phone_number()

相关文章

网友评论

      本文标题:Python生成随机电话号码

      本文链接:https://www.haomeiwen.com/subject/febgkxtx.html