lee88888
# Author:BeeLe

# -*- coding: utf-8 -*-
import random


def create_phone():
# 第二位数字
second = [3, 4, 5, 7, 8][random.randint(0, 4)]
# 第三位数字
third = {3: random.randint(0, 9),
4: [5, 7, 9][random.randint(0, 2)],
5: [i for i in range(10) if i != 4][random.randint(0, 8)],
7: [i for i in range(10) if i not in [4, 9]][random.randint(0, 7)],
8: random.randint(0, 9), }[second]
# 最后八位数字
suffix = random.randint(9999999, 100000000)
# 拼接手机号
return "1{}{}{}".format(second, third, suffix)
# p = create_phone()
# 生成手机号
# print(p)

分类:

技术点:

相关文章:

  • 2021-09-06
  • 2021-11-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-02
  • 2022-01-02
  • 2021-12-23
  • 2021-10-11
  • 2022-12-23
  • 2021-07-09
相关资源
相似解决方案