diff options
Diffstat (limited to 'challenge-246/eric-cheung/python/ch-1.py')
| -rwxr-xr-x | challenge-246/eric-cheung/python/ch-1.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/challenge-246/eric-cheung/python/ch-1.py b/challenge-246/eric-cheung/python/ch-1.py new file mode 100755 index 0000000000..5ad578ad8b --- /dev/null +++ b/challenge-246/eric-cheung/python/ch-1.py @@ -0,0 +1,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)
|
