Recall & Review
beginner
What does the
print() function do in Python?The
print() function shows text or other data on the screen so the user can see it.Click to reveal answer
beginner
How do you print the text Hello, world! using
print()?Use
print("Hello, world!") to show the text Hello, world! on the screen.Click to reveal answer
beginner
Can
print() show numbers without quotes? Example: print(123)Yes,
print() can show numbers directly without quotes. It prints the number as is.Click to reveal answer
beginner
What happens if you use multiple items inside
print() separated by commas? Example: print('Age:', 30)It prints all items separated by spaces. Example output:
Age: 30Click to reveal answer
intermediate
How do you print text on the same line without a new line after using
print()?Use
print(..., end='') to stop print() from moving to a new line after printing.Click to reveal answer
What is the default behavior of
print() after printing the content?✗ Incorrect
By default,
print() adds a new line after printing so the next output starts on a new line.How do you print multiple items separated by spaces?
✗ Incorrect
Using commas inside
print() prints each item separated by a space automatically.Which of these will print the number 10?
✗ Incorrect
Both
print(10) and print('10') print 10, but the first prints a number, the second prints a string.How to prevent
print() from adding a new line after printing?✗ Incorrect
The
end parameter controls what print() adds after printing. Setting end='' stops the new line.What will
print('Hello', 'World') output?✗ Incorrect
Using commas prints items separated by spaces, so the output is 'Hello World'.
Explain how the
print() function works and how to print multiple items.Think about how you tell a friend multiple things in one sentence.
You got /3 concepts.
Describe how to print text without moving to a new line after printing.
Imagine writing on the same line without pressing Enter.
You got /3 concepts.