34.0k views
3 votes
True or False:

A literal string like a "doc string" can be written over several lines as long as it is contained in a set of triple quotes.

User Clifgray
by
8.0k points

1 Answer

7 votes

Final answer:

True, a literal string akin to a 'doc string' can be written over multiple lines within triple quotes, a feature frequently utilized in programming languages like Python. It is indeed possible to write a literal string that spans several lines using triple quotes.

Step-by-step explanation:

The student's question relates to the formatting of literal strings in a programming context, specifically mentioning a scenario similar to doc strings. The answer to the question is True. It is indeed possible to write a literal string that spans several lines using triple quotes. This is a common practice in many programming languages, such as Python, where triple-quoted strings are often used for documentation strings (docstrings) as well as multi-line strings.

User Trillion
by
8.1k points