aboutsummaryrefslogtreecommitdiff
path: root/challenge-286/eric-cheung/python/ch-1.py
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-286/eric-cheung/python/ch-1.py')
-rwxr-xr-xchallenge-286/eric-cheung/python/ch-1.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/challenge-286/eric-cheung/python/ch-1.py b/challenge-286/eric-cheung/python/ch-1.py
new file mode 100755
index 0000000000..c8083edb23
--- /dev/null
+++ b/challenge-286/eric-cheung/python/ch-1.py
@@ -0,0 +1,18 @@
+
+import sys
+import random
+
+objFile = open(sys.argv[0], "r")
+
+arrContent = objFile.readlines()
+
+arrOutput = []
+for strLoop in arrContent:
+ strLoop = strLoop.replace("\n", "")
+ if not strLoop:
+ continue
+ arrOutput = arrOutput + strLoop.split(" ")
+
+## print (arrOutput)
+
+print (arrOutput[random.randrange(len(arrOutput))])