nerdexam
Python_Institute

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

PEP and Best Practices

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)
  • A
    88% (23)
  • C
    8% (2)
  • D
    4% (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

#PEP 8#string quotes#single quotes#double quotes

Community Discussion

No community discussion yet for this question.

Full PCPP-32-101 Practice