Select the true statement about PEP 8 recommendations related to line breaks and binary operators.
A.
It is recommended that you use line breaks before binary operators to improve code readability
B.
It is permissible to use line breaks before or after a binary operator, as long as the convention is consistent locally. However, for new code, it is recommended that break lines should be used only after binary operators.
C.
It is recommended that you use line breaks after binary operators to improve code readability
D.
There is no specific PEP 8 recommendation related to using line breaks with binary operators
PEP8 now (since 2016-06-08) recommends breaking before the binary operator.
Even though in Python you’re allowed to break code lines before or after binary operators (providing you do so consistently and that this convention has been used in your code before), it is recommended that you follow Donald Knuth’s style suggestions and break before binary operators as this results in a more readable, eye-friendly code.
https://edube.org/learn/pcpp1-python-enhancement-proposals-peps/pep-8-code-layout-1
upvoted 1 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Moneybing
1 year, 2 months ago