Back to Freecodecamp

Building a Guessing Game

curriculum/challenges/english/blocks/dictionaries-and-loops/building-a-guessing-game-video.md

latest531 B
Original Source

--description--

In this video, you will build a guessing game that uses loops and conditionals.

--questions--

--text--

What does the condition guess != secret_word mean in this code?

python
secret_word = "giraffe"
guess = ""

while guess != secret_word:
    guess = input("Enter guess: ")

--answers--

If guess is not equal to secret_word.


If guess is equal to secret_word.


If guess is greater than secret_word.


If guess is less than secret_word.

--video-solution--

1