Question Detail
Question
Which of these lines of code correctly defines a multi-line string in Python?
Correct Answer
Option D is the correct answer.
Detailed Explanation
While triple quotes (
"""""" or ''' ''') are explicitly mentioned for 'Multi-line' strings, single and double quotes can also define multi-line strings by explicitly including newline characters (\n). Therefore, all options are valid ways to define a string with multiple lines.
Hint
Although triple quotes are designed for multi-line strings, `\n` can be used within single or double quotes to achieve the same effect.