Question Detail

COS 102 lecture 4 Objective Question

Question

When would you typically use triple quotes to indicate a string literal in Python?
Options
A Only for single-character strings.
B When the string contains special characters like '@'.
C When the string runs across several lines.
Correct Answer
D When the string needs to be converted to a number.
Correct Answer

Option C is the correct answer.

Detailed Explanation

Page 20 states, 'You would use the triple quotes when your string runs across several lines.'

Hint

Review the 'Using Quotations' section on page 20, specifically the purpose of triple quotes.

Question Info