Guess a Word
Guess a Word. In this section of the course, you’ll build a very basic word-guessing game. The game won’t look good, and the feedback from it will be hard to parse if it’s present at all. Still, the building blocks for your Wordle clone will be in place by the end of this phase of the project. You’ll use
input() to read words from your players, a
for loop to give your users several guesses, and sets to find out which letters your users have guessed correctly.
The prompt asks the user to guess the word, and the user enters
snake and then hits Enter. The call to
input() returns the text that the user enters. You can see this in this example, as the string
"snake" has been assigned to
01:39 It’s usually a good idea to create code that runs as early as possible. Even if it’s just doing something small and is far away from your end goals, making it runnable means you can start experimenting, testing, and debugging.
01:53 Now this may not look like much of a game, and even if you do think of it as one, it’s probably fairly boring. There’s little replayability because the secret word is always the same, and the feedback isn’t actionable for the user since they don’t learn much from just being told that they’re wrong.
Become a Member to join the conversation.