Python Print Function MCQS
Q. Which function displays output in Python 3?
Solution:
print() is the built-in output function in Python 3.
Q. What is the output of print("A", "B")?
Solution:
The default separator (sep) is a single space.
Q. What is the default value of the end parameter in print()?
Solution:
print() ends each call with a newline unless you change end.
Q. What does print("x", "y", sep="-") output?
Solution:
sep replaces the default space between values.
Q. What is the output of x = 5; print(f"{x * 2}")?
Solution:
Expressions inside an f-string’s braces are evaluated.
Q. Which line raises a TypeError?
Solution:
The + operator cannot join a str and an int.
Q. How do you print 1 2 3 on one line using a loop?
Solution:
end=” ” replaces the newline with a space.
Q. What does print(f"{3.14159:.2f}") output?
Solution:
2f formats a float with exactly two decimals.
Q. What is the return value of print()?
Solution:
print() writes to output and returns None.
Get Question Bank
Strengthen Your Practice with our comprehensive question bank.