Question: In this task you will use strings, simple while loops , the if/elif/else statement , and the in operator. In the popular word game Wordle,
In this task you will use strings, simple while loops, the if/elif/else statement, and the in operator.
In the popular word game Wordle, users have to guess a 5-letter English word and get hints based on their guesses. Your task is to code a simplified version of the game, called µWordle ("Micro-Wordle").
Your program should take an input from the user and first check whether it has 5 letters. If it does, it checks whether the word is in the list of allowed words. Only if it is, it outputs the number of correct letters, i.e. the number of positions where the input letter and the secret word letter are identical. (Note that this is easier to program than Wordle, but much harder to play!)
The game should continue to ask for input until the secret word is found.
Since this is an exercise and not a real game, we are providing only a short word list. Please use it as-is and do not modify it. The real Wordle has a list of more than 10,000 English 5-letter words.
Example Here is an example dialog with the user: Enter your guess: Python Please enter a 5-letter word Enter your guess: hello Not in word list Enter your guess: memes The number of correct letters is 0 Enter your guess: until The number of correct letters is 0 Enter your guess: yield The number of correct letters is 1 Enter your guess: whine The number of correct letters is 4 Enter your guess: while Well done! K 71
Step by Step Solution
3.55 Rating (148 Votes )
There are 3 Steps involved in it
Sure heres a Python program that implements the simplified Wordle game as described python List of a... View full answer
Get step-by-step solutions from verified subject matter experts
