Last active
October 14, 2020 19:05
-
-
Save cghiban/ec3db0b8d260ce922ceefb85b91c7311 to your computer and use it in GitHub Desktop.
Spelling for beginners (it works on a mac)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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