Python_Institute
PCPP-32-101 · Question #75
Select the true statements related to PEP 257. (Choose two.)
The correct answer is A. All modules, and all functions and classes exported by a module, should have docstrings. C. You should always use triple double quotes (""") to open and close a docstring. PEP 257 recommends that all modules, functions, and classes intended to be used publicly should have docstrings. PEP 257 specifies using triple double quotes (""") consistently for docstrings.
PEP and Best Practices
Question
Select the true statements related to PEP 257. (Choose two.)
Options
- AAll modules, and all functions and classes exported by a module, should have docstrings.
- BYou should always use triple single quotes (''') for Unicode docstrings and triple double quotes
- CYou should always use triple double quotes (""") to open and close a docstring.
- DNon-public methods are required to have docstrings, and these should be followed by a blank line.
How the community answered
(64 responses)- A89% (57)
- B3% (2)
- D8% (5)
Explanation
PEP 257 recommends that all modules, functions, and classes intended to be used publicly should have docstrings. PEP 257 specifies using triple double quotes (""") consistently for docstrings.
Topics
#PEP 257#docstrings#triple quotes#module documentation
Community Discussion
No community discussion yet for this question.