Display the Quiz

Print the quiz title and first question on the screen

💻

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

Show something on screen

The first thing a player sees when they start PyQuiz is the title and a question. Before you can check answers or keep score, you need to display something.

To put text on the screen, you use print():

print("Good morning!")

This displays Good morning! in the terminal. The text inside the quotes is called a string — a piece of text that Python treats as data.

You can call print() as many times as you want. Each call displays one line:

print("Good morning!")
print("How are you?")

Calling print() with nothing inside the parentheses prints a blank line. This adds spacing between sections:

print("Good morning!")
print()
print("How are you?")

One more thing: lines that start with # are comments. Python ignores them completely. They are notes for you — a way to mark what each section of code does:

# Display a greeting
print("Good morning!")

Instructions

Display the quiz title and the first question.

  1. Call print() with the text === Python Quiz === — this is the title the player sees when they start the quiz.
  2. Call print() with no arguments — this adds a blank line that separates the title from the question visually.
  3. Call print() with the text What is the type of the value 3.14? — this is the first question the player will answer.