Skip to content

Instantly share code, notes, and snippets.

@cghiban
Last active October 14, 2020 19:05
Show Gist options
  • Select an option

  • Save cghiban/ec3db0b8d260ce922ceefb85b91c7311 to your computer and use it in GitHub Desktop.

Select an option

Save cghiban/ec3db0b8d260ce922ceefb85b91c7311 to your computer and use it in GitHub Desktop.
Spelling for beginners (it works on a mac)
import random, subprocess, time
words = [
'safe', 'wake', 'late', 'grade','cage',
'plane', 'shape', 'away', 'gray', 'pray'
]
for i in range(len(words)):
word = words[i]
while True:
subprocess.call(["say", word])
answer = input("> ")
if answer.lower() == word.lower():
print("Good job!")
time.sleep(0.4)
break
else:
print("Nope. Try again")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment