Recall & Review
beginner
What is the purpose of the
print() function in Python?The
print() function shows text or values on the screen. It helps us see the output of our program.Click to reveal answer
beginner
Write the simplest Python code to display the message: Hello World
Use
print("Hello World") to show the message on the screen.Click to reveal answer
beginner
Why do we put text inside quotes in
print()?Quotes tell Python that the text is a message (string) to show exactly as it is.
Click to reveal answer
beginner
What happens if you forget the parentheses in
print in Python 3?Python will give an error because
print is a function and needs parentheses to work.Click to reveal answer
beginner
What is the output of this code?<br>
print("Hello World")The output will be:<br>
Hello World
Click to reveal answer
Which Python function is used to display text on the screen?
✗ Incorrect
The
print() function is used to show text or values on the screen.What will this code print?<br>
print("Hello")✗ Incorrect
The code prints the text inside quotes exactly as it is, so it shows Hello.
In Python 3, what is missing in this code?<br>
print "Hello World"
✗ Incorrect
In Python 3,
print is a function and needs parentheses like print("Hello World").Why do we use quotes inside
print()?✗ Incorrect
Quotes tell Python that the text is a string message to show exactly as written.
What will happen if you run this code?<br>
print(Hello World)
✗ Incorrect
Without quotes, Python thinks Hello and World are variables, causing an error if they are not defined.
Explain how to write your first Python program that shows 'Hello World' on the screen.
Think about how to tell Python to show a message.
You got /4 concepts.
What are common mistakes beginners make when writing the first Python program?
Focus on syntax rules for the print function.
You got /4 concepts.