Skip to content

Instantly share code, notes, and snippets.

@bryant
Created November 14, 2017 00:44
Show Gist options
  • Save bryant/a6d4236c336f2bae98979c8e6fcec428 to your computer and use it in GitHub Desktop.
Save bryant/a6d4236c336f2bae98979c8e6fcec428 to your computer and use it in GitHub Desktop.
I needed to learn the phoenetic alphabet.
from random import choice
from string import lowercase
from datetime import datetime
answers = [
"alpha",
"bravo",
"charlie",
"delta",
"echo",
"foxtrot",
"golf",
"hotel",
"india",
"juliett",
"kilo",
"lima",
"mike",
"november",
"oscar",
"papa",
"quebec",
"romeo",
"sierra",
"tango",
"uniform",
"victor",
"whiskey",
"xray",
"yankee",
"zulu",
]
answers = zip(lowercase, answers)
while True:
letter, phoenetic = choice(answers)
if raw_input(datetime.now().isoformat() + " " + letter + "? ").lower() != phoenetic:
print "Wrong. Expected " + phoenetic
else:
print "Correct."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment