Add Answer Options

Show four numbered choices below the question

💻

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

The player needs choices

A question on its own is not a quiz — the player needs answer options to choose from. Each question in PyQuiz shows four numbered choices:

What is the type of the value 3.14?

  1) int
  2) str
  3) float
  4) bool

You already know how to print one line. To print a list of options, call print() once for each:

print("  1) apple")
print("  2) banana")

The two spaces at the start of each line indent the options. This makes them stand out visually under the question.

Instructions

Add four answer options below the question.

  1. Call print() with no arguments to add a blank line between the question and the options.
  2. Print the four options, each on its own line with two spaces of indentation:
    • 1) int
    • 2) str
    • 3) float
    • 4) bool