"""
這是一個雙色球號碼生成程序
紅球【1-32】32選6
藍球【1-16】16選1
@author 楊波
@since 2021.1.11
"""
# 加載模塊
import random
# 雙色球號碼生成程序
def ssq():
# 初始化紅球列表
reds = [0, 0, 0, 0, 0, 0]
# 初始化藍球列表
blue = [0]
# 紅球【1-32】32選6
i = 0
while i < 6:
# 紅球,1-32隨機數
red = random.randint(1, 32)
if reds.count(red) == 0:
reds[i] = red
i = i + 1
# 藍球【1-16】16選1
blue[0] = random.randint(1, 16)
# 最終雙色球結果
reds.sort()
reds.append(blue[0])
print(reds)
特別聲明:以上內容(如有圖片或視頻亦包括在內)為自媒體平臺「網易號」用戶上傳並發布,本平臺僅提供信息存儲服務。
Notice: The content above (including the pictures and videos if any) is uploaded and posted by a user of NetEase Hao, which is a social media platform and only provides information storage services.