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.
- Call
print()with the text=== Python Quiz ===— this is the title the player sees when they start the quiz. - Call
print()with no arguments — this adds a blank line that separates the title from the question visually. - Call
print()with the textWhat is the type of the value 3.14?— this is the first question the player will answer.
# Step 1: Print the quiz title # Step 2: Print a blank line # Step 3: Print the question
Interactive Code Editor
Sign in to write and run code, track your progress, and unlock all chapters.
Sign In to Start Coding