aboutsummaryrefslogtreecommitdiff
path: root/challenge-286/eric-cheung/python/ch-1.py
blob: c8083edb23b08cf767f27712b300f6addc0fa546 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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))])