Skip to main content

Practice ยท 3 of 3

Guessing Steps (deterministic)

secret = 7 is given, and guesses = [4, 9, 7] simulates the player. Walk the guesses in order with a for loop and print each guess, stopping (break) the moment the secret is found. The winning guess must be printed too.

Difficulty: beginner

Back to lesson: Practice: while & Game Logic