python案例之随机产生固定要求的一串号码 案例背景 第一位:1 第二位:3,4,5,7,8 第三位: 13 【0-9】 14 [5,7,9] 15 [0-9] !=4 17 [0-9] !=4and 9 18 [0-9] 代码如下: #导入包 import random #随机产生多少个号码函数 def create_phone(num): total=[] for n in range(0,num): #第二位 second=[3,4,5,7,8][random.randint(0,