蛇年快乐8组号Python代码

360影视 2025-02-07 09:09 3

摘要:蛇年快乐8组号Python代码,昨天写的快乐8组合选号Python代码。看快乐8 走势图可同发现每期大约有5个左右的上期下移号码,大约有3到4个上上期的号码,以此作为组号的依据:

蛇年快乐8组号Python代码,昨天写的快乐8组合选号Python代码。看快乐8 走势图可同发现每期大约有5个左右的上期下移号码,大约有3到4个上上期的号码,以此作为组号的依据:

快乐8组号

import random# 定义号码池以此为上上期号码+上期号码+自选多个号码last_last_period = [2, 3, 5, 7, 12, 13, 23, 26, 29, 39, 43, 44, 48, 60, 62, 63, 64, 74, 77, 79]last_period = [4, 11, 12, 13, 17, 20, 23, 33, 40, 43, 44, 50, 53, 60, 63, 65, 67, 68, 72, 80]preselected_numbers = [6, 7, 8, 9, 12, 15, 16, 17, 18, 22, 25, 28, 35, 38, 39, 45, 48, 49, 55, 58, 60, 62, 63, 65, 67, 68, 70, 72, 73, 75, 77]# 从预选号码中筛选出既不在上期也不在上上期的号码remaining_numbers = [num for num in preselected_numbers if num not in last_last_period and num not in last_period]# 从预选号码中筛选出在上上期但不在上期的号码last_last_unique = [num for num in preselected_numbers if num in last_last_period and num not in last_period]# 从预选号码中筛选出在上期的号码last_period_preselected = [num for num in preselected_numbers if num in last_period]# 生成10组号码results = for _ in range(10): # 从上期号码池中随机选择4到5个号码 last_period_selected = random.sample(last_period_preselected, random.randint(4, 5)) # 从上上期(不在上期)号码池中随机选择2到3个号码 last_last_unique_selected = random.sample(last_last_unique, random.randint(2, 3)) # 从剩余的号码池中选择剩余的号码,直到总数达到10个 remaining_to_select = 10 - len(last_period_selected) - len(last_last_unique_selected) remaining_selected = random.sample(remaining_numbers, remaining_to_select) # 合并并排序 selected_numbers = sorted(last_period_selected + last_last_unique_selected + remaining_selected) results.append(selected_numbers)# 打印结果for i, result in enumerate(results, 1): print(f"第{i}组号码: {result}")

模拟运行结果如下:

快乐8组号代码

昨日快乐8

正在运行程序...

第1组号码: [12, 17, 35, 38, 39, 45, 49, 60, 65, 67]

第2组号码: [12, 17, 35, 39, 60, 62, 63, 73, 75, 77]

第3组号码: [7, 28, 39, 58, 63, 65, 68, 72, 75, 77]

第4组号码: [9, 12, 17, 38, 39, 60, 67, 68, 75, 77]

第5组号码: [12, 16, 35, 38, 49, 63, 65, 68, 72, 77]

江东旭侯快乐8代码

第6组号码: [7, 12, 17, 35, 48, 63, 65, 70, 72, 77]

第7组号码: [6, 12, 15, 17, 48, 60, 62, 67, 72, 73]

第8组号码: [9, 12, 17, 25, 45, 58, 60, 62, 63, 77]

第9组号码: [12, 15, 17, 18, 48, 60, 67, 68, 73, 77]

第10组号码: [7, 12, 16, 35, 38, 48, 63, 68, 72, 77]

快乐8统计组号,仅供娱乐!

一点说明:每次运行的结果都不一样哦!

来源:江东旭侯

相关推荐