I read a (somewhat) humorous story about the TSA paying a developer $1.4M for an app that simply outputs a random "Left" or "Right" arrow. I decided to try it myself in Python.
I am wondering if I could shorten the if-else statement using something like a Lambda expression or list comprehension... a syntactic shorthand for conditionally printing strings.
import os, datetime, random
while True:
os.system('clear')
print "ENTER to continue, or type 'quit'"
print datetime.datetime.now()
print ''
i = random.randint(1,2)
if i == 1:
print 'Left'
else:
print 'Right'
print ''
prompt = raw_input("")
if prompt == 'quit':
quit()