QuestionQ48

VerifiedCoding Conventions, Best Practices, and Standardization

Review the following examples of Python comments and docstrings. Select those that are useful and follow PEP 8 recommendations.

Choose two
Explanation

A block comment should describe the code that follows it, use # followed by a space, and consist of clear complete sentences. A multi-line docstring should start with a summary line, followed by a blank line before its detailed argument documentation. Inline comments must not contradict the statement they annotate and should be separated from the statement by at least two spaces. PEP 8 and PEP 257 define these conventions.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!