PCPP-32-101 · Question #16
Which of the following examples using line breaks and different indentation methods are compliant with PEP 8 recommendations? (Choose two.) A. B. C. D.
The correct answer is A. spam = my_function(arg_one, arg_two, arg_three, arg_four) C. my_list = [ 1, 2, 3, 4, 5, 6, ]. A: The first example in (https://peps.python.org/pep-0008/#indentation). Vertical alignment with the opening delimiter C: The closing braces/bracket/parenthesis on multiline constructs may either line up under the first non-whitepace character of the last line of the list or…
Question
Which of the following examples using line breaks and different indentation methods are compliant with PEP 8 recommendations? (Choose two.) A. B. C. D.
Exhibit
Options
- Aspam = my_function(arg_one, arg_two, arg_three, arg_four)
- Beggs = (1, 2, 3, 4, 5, 6)
- Cmy_list = [ 1, 2, 3, 4, 5, 6, ]
- Dfoo = my_function ( arg_one, arg_two, arg_three, arg_four )
How the community answered
(59 responses)- A92% (54)
- B3% (2)
- D5% (3)
Explanation
A: The first example in (https://peps.python.org/pep-0008/#indentation). Vertical alignment with the opening delimiter C: The closing braces/bracket/parenthesis on multiline constructs may either line up under the first non-whitepace character of the last line of the list or may be lined up under the first character of the line that starts the multiline construct.
Topics
Community Discussion
No community discussion yet for this question.
