# double ball game
import random
count = 10000000000 # 设置多少注
blue_start = 1
blue_end = 5
a = []
def make_surprise():i = 0while i < 6:i += 1number = random.randrange(1, 32, 1)a.append(format('{:02d}'.format(number)))a.append(format('{:02d}'.format(random.randrange(blue_start, blue_end, 1))))return a
print("中奖号码是: ")
wawa = []
wawa = make_surprise()
print(wawa)
print("希望你中奖,祝你好运!")while count > 0:count -= 1a = []i = 0while i < 6:i += 1number = random.randrange(1,32,1)a.append(format('{:02d}'.format(number)))a.append(format('{:02d}'.format(random.randrange(blue_start, blue_end, 1))))print(a)if a == wawa:print("***** 恭喜您中奖啦 ******* ")break
闲着无聊练习下python基础,怕是忘记了不少,彩票中奖的概率真滴低,一个函数自己制造一个7个数字的列表作为中奖号码,然后随机下注,给了1000000万注试了下,不知到合适可以中奖