Hangman is a classic word-guessing game that has been popular for generations. The game is played with two or more…