國慶日補假
繼續在家中寫CODE
二の型: 實際抽法49彩球
import random
import numpy as np
biglottery = np.array(range(1,50))
for item in biglottery:
roll = int (random.random() * 49 ) #找1顆球
roll2 = int (random.random() * 49 ) #找另1顆球
temp = biglottery[roll]
biglottery[roll] = biglottery[roll2]
biglottery[roll2] = temp #滾動交換
print("大樂透號:")
print(biglottery[0:6])
print("特別號:")
print(biglottery[6])
大樂透號:
[42 2 3 17 40 24]
特別號:
33