Single Choice
Not Set
QOutput displayed by the print function will add this invisible character at the end of the line by default ...
ID: #3396
Python Basic MCQ
574 views
Question Info
#3396Q ID
Not SetDifficulty
Python Basic MCQTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer
Explanation
By default, the print() function ends its output with the
newline character \n. This moves the cursor to the beginning of
the next line after displaying the output.
Example:
print("Hello")
print("World")
Output:
Hello
World
This happens because the default value of the end parameter in
the print() function is "\n".
Example:
print("Hello", end="\n")
print("World")
The other options are incorrect because:
\trepresents a horizontal tab.\sis not a valid Python escape sequence.\rrepresents a carriage return.
Therefore, the correct answer is
Option B) \n.
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic