Design and implement a program that allows the user to play a game similar to Wheel of
Question:
Design and implement a program that allows the user to play a game similar to Wheel of Fortune. Wheel of Fortune is a popular word game in which the player is given a category (Movie, Famous Person) and some number of blanks representing each character in the name of the movie or person. The user guesses one letter at a time and the program updates the display to include the letter where it appears in the name. The program should also display any character that was guessed incorrectly as well as the number of incorrect guesses remaining. The game ends when the user has filled in all of the characters or has reached the guessed incorrectly 5 times for a particular puzzle. The user should be allowed to play puzzles repeatedly and the program should keep track of how many puzzles the user has completed successfully.
Here is the code that is provided.
import random
def getPuzzle():
\"\"\"This function returns a tuple (Category, Phrase) that can be used to play a simple game of like
Wheel of Fortune.\"\"\"
puzzles = [(\"Famous People\", \"Abraham Lincoln\"), (\"Famous People\", \"Oprah Winfrey\"),(\"Famous People\", \"Will Smith\"),
(\"Famous People\", \"Marilyn Monroe\"),
(\"Action Movie\", \'Mad Max: Fury Road\'),
(\"Action Movie\", \'Die Hard\'),
(\"Action Movie\", \'John Wick\'),
(\"Action Movie\", \'Enter the Dragon\')]
index = random.randint(0, len(puzzles))
return puzzles[index]
def main():
\"\"\"docstring comment for the program goes here\"\"\"
(category, name) = getPuzzle()
print(category)
print(name)
if __name__ == \'__main__\':
main()