PCPP-32-101 · Question #76
Select the true statements related to PEP 8 recommendations for string quotes. (Choose two.)
The correct answer is A. Single-quote and double-quote strings are two equally good methods for delimiting strings - Python B. When a string contains single or double quotes, it should be delimited in a way that avoids using. PEP 8 states that single and double quotes are both acceptable for strings, but consistency within a project is important. To improve readability, strings containing quotes should be delimited to avoid unnecessary
Question
Select the true statements related to PEP 8 recommendations for string quotes. (Choose two.)
Options
- ASingle-quote and double-quote strings are two equally good methods for delimiting strings - Python
- BWhen a string contains single or double quotes, it should be delimited in a way that avoids using
- CIt is recommended that single quotes be used for natural language messages, and double quotes
- DYou should always use single quote characters for triple-quote strings in order to be consistent
How the community answered
(26 responses)- A88% (23)
- C8% (2)
- D4% (1)
Explanation
PEP 8 states that single and double quotes are both acceptable for strings, but consistency within a project is important. To improve readability, strings containing quotes should be delimited to avoid unnecessary
Topics
Community Discussion
No community discussion yet for this question.