aboutsummaryrefslogtreecommitdiff
path: root/challenge-246/eric-cheung/python/ch-1.py
blob: 5ad578ad8b8e785c69d875fb522c17266fa23210 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from random import randint

nMaxNum = 49
nNumChosen = 6

arrInput = list(range(1, nMaxNum + 1))
arrOuput = []

for nLoop in range(nNumChosen):
    nIndx = randint(0, nMaxNum - nLoop)
    arrOuput.append(arrInput[nIndx])
    del arrInput[nIndx]

arrOuput.sort()

print (arrOuput)