Using the expression and putting it in its own function is usually pretty clear. It lets you give a label to the condition. You can also put each comparison on its own line if the expression is too long.
def is_leap_year(year): return ( year % 4 == 0 and ( year % 100 != 0 or year % 400 == 0 ) )
The logical operators stand out more when they're at the beginning of a line.
I agree too
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Using the expression and putting it in its own function is usually pretty clear. It lets you give a label to the condition. You can also put each comparison on its own line if the expression is too long.
The logical operators stand out more when they're at the beginning of a line.
I agree too