QuestionQ61

VerifiedCoding Conventions, Best Practices, and Standardization

Which of the following examples that use line breaks and different indentation approaches comply with the PEP 8 recommendations?

Choose two
Explanation

PEP 8 specifies four spaces per indentation level, prefers spaces over tabs, and allows a multiline function definition when a hanging indent clearly distinguishes continuation lines. A correctly indented function body also requires a four-space indentation level. Therefore, the compliant examples are the hanging-indent definition and the function whose body lines are both indented by four spaces.

Learn more

Community Discussion

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