download the sound files from these urls (or use your own) try import playsound except importerror print('the playsound module needs to be installed to run this' print('program on windowsopen command prompt and run:' print('pip install playsound' print('on macos and linuxopen terminal and run:' print('pip install playsound' sys exit( print('''sound mimicby al sweigart al@inventwithpython com try to memorize pattern of letters (each with its own sound as it gets longer and longer ''' input('press enter to begin ' pattern ' while true print('\ clear the screen by printing several newlines add random letter to the pattern pattern pattern random choice('asdf' display the pattern (and play their sounds) print('pattern'end='' for letter in pattern print(letterend='flush=true playsound playsound('soundletter wav' time sleep( add slight pause at the end print('\ clear the screen by printing several newlines let the player enter the pattern print('enter the pattern:' response input(''upper( if response !pattern print('incorrect!' print('the pattern was'pattern else print('correct!' for letter in pattern playsound playsound('soundletter wav' if response !patternsound mimic