correctletters append(guess check if the player has won foundallletters true start off assuming they've won for secretwordletter in secretword if secretwordletter not in correctletters there' letter in the secret word that isn' yet in correctlettersso the player hasn' won foundallletters false break if foundallletters print('yesthe secret word is:'secretword print('you have won!' break break out of the main game loop else the player has guessed incorrectly missedletters append(guess check if player has guessed too many times and lost (the " is because we don' count the empty gallows in hangman_pics if len(missedletters=len(hangman_pics drawhangman(missedletterscorrectletterssecretword print('you have run out of guesses!' print('the word was "{}"format(secretword) break def drawhangman(missedletterscorrectletterssecretword) """draw the current state of the hangmanalong with the missed and correctly-guessed letters of the secret word "" print(hangman_pics[len(missedletters)] print('the category is:'category print( show the incorrectly guessed letters print('missed letters'end='' for letter in missedletters print(letterend=' if len(missedletters= print('no missed letters yet ' print( display the blanks for the secret word (one blank per letter) blanks [' 'len(secretword replace blanks with correctly guessed letters for in range(len(secretword)) if secretword[iin correctletters blanks[isecretword[ show the secret word with spaces in between each letter print(join(blanks) project #