iT邦幫忙

1

Python求解! 大神請幫幫忙

你可以去買大樂透 用大數據來計算中獎的號碼
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

1
海綿寶寶
iT邦大神 1 級 ‧ 2021-10-28 08:44:08
最佳解答

https://ithelp.ithome.com.tw/upload/images/20211028/20001787Yc4EzS9zyu.png

參考資料來源

後面換一種方式

import random

nLotto = random.sample(range(1,40),5)
nLotto.sort()
print('Lotto numbers :', nLotto)
print('input six integers:')
nBet = list(map(int, input("Enter 6 values:").split()))
nBet.sort()
print('Bet numbers :',nBet)

sLot = set(nLotto)
sBet = set(nBet)
cnt = len(sLot.intersection(sBet))
jackpot = [0, 0, 50, 300, 20000, 8000000]
print(jackpot[cnt])

好主意
/images/emoticon/emoticon34.gif

我要發表回答

立即登入回答