198k views
2 votes
What can be used to surround a multi-line string in a Python code cell by appearing before and after the multi-line string?

A) ''' '''
B) " "
C) ( )
D) { }

1 Answer

7 votes

Final answer:

In Python, multi-line strings are surrounded by triple quotes, which is option A) ''' '''. Options B, C, and D are incorrect for multi-line strings.

Step-by-step explanation:

To surround a multi-line string in a Python code cell, you can use triple quotes. The correct option from those listed is A) ''' '''. Neither option B) " " nor D) { } can be used for this purpose as double quotes are for single-line strings and curly brackets are used for sets or dictionaries. Option C) ( ) can be used to wrap a line for continuation but does not encapsulate strings. With triple quotes, you can create a string that spans several lines and includes line breaks in the string itself.

User Hamed Tabatabaei
by
7.6k points

No related questions found

Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.