參考資料來源
後面換一種方式
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])
好主意