Show the Result

Display the player's answer and the correct answer after they submit

💻

Writing code and entering commands is only available on desktop. Open this page on a larger screen to complete this chapter.

The player typed an answer and pressed Enter, but the quiz exits immediately. There is no acknowledgement of what they chose or what the right answer was. You need to show both so the player knows what happened.

A blank line separates the input prompt from the result — the same visual rhythm used elsewhere in the quiz. Then two lines tell the player what they submitted and what the correct option number is.

Note: at this point, the quiz cannot say "Correct!" or "Wrong!" — deciding that requires comparing two values with an operator, which you will do in Lesson 4. For now, you display the facts and let the player draw their own conclusion.

Instructions

Display the player's answer and the correct answer.

  1. After answer = int(answer_text), add a blank line with print() — this separates the input prompt from the results, matching the visual rhythm used throughout the quiz.
  2. Add print(f"You answered: {answer}") — this confirms to the player what choice they submitted.
  3. Add print(f"The correct answer is: {correct}") — this shows the right answer so the player can see whether they matched it.