标签:port rand 随机 pen join append app python int
随机产生8位数,每位数都是1~6之间数字
import random list_1 = [i for i in xrange(1,7)] print list_1 arr_1=[] for i in range(8): arr_1.append(str(random.choice(list_1))) data = int(‘‘.join(arr_1)) print data
标签:port rand 随机 pen join append app python int
原文地址:https://www.cnblogs.com/saryli/p/8932930.html