标签:== append not dom style sdi insert nbsp while
import random num = (input(‘输入需要购买的彩票数:‘)).strip() if num and num.isdigit() and int(num) >0: l2 = [] for i in range(int(num)): l = [] while len(l) < 5: b = random.randint(1, 35) b = str(b).zfill(2) if b not in l: l.append(b) l.sort() b = random.randint(1, 12) b = str(b).zfill(2) l.append(b) while len(l) < 7: b = random.randint(1, 2) b = str(b).zfill(2) if int(b) == int(l[5]): continue elif int(b) > int(l[5]): l.append(b) else: l.insert(5, b) if l not in l2: l2.append(l) qian = l2[i][:5] hou = l2[i][-2:] print(‘第%s注彩票,前区:%s,后区:%s‘%(i,qian,hou)) else: print(‘输入错误‘)
标签:== append not dom style sdi insert nbsp while
原文地址:https://www.cnblogs.com/shengqi/p/11741240.html