QuestionQ31

VerifiedCoding Conventions, Best Practices, and Standardization

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

Choose two
Explanation

PEP 8 recommends vertically aligning wrapped elements when an opening delimiter appears on a line containing arguments, which is satisfied by the continued function arguments. It also allows the closing bracket of a multiline list to align with the list elements. A non-vertically-aligned continuation after arguments already appear on the first line is not compliant, and multiline function-call contents must be clearly indented. PEP 8 – Style Guide for Python Code

Learn more

Community Discussion

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