0
0
Pythonprogramming~5 mins

print() function basics in Python - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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: 30
Click 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?
AIt moves to a new line
BIt stays on the same line
CIt clears the screen
DIt pauses the program
How do you print multiple items separated by spaces?
AUse plus signs (+) between items
BPut all items inside one string
CSeparate items with commas inside <code>print()</code>
DUse semicolons between items
Which of these will print the number 10?
ANone of the above
Bprint('10')
Cprint(10)
DBoth B and C
How to prevent print() from adding a new line after printing?
AUse <code>skip_line=True</code>
BUse <code>end=''</code> parameter
CUse <code>newline=False</code>
DUse <code>start=''</code> parameter
What will print('Hello', 'World') output?
AHello World
BHelloWorld
CHello, World
DHello 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.