, . and or, :
a and b or c
:
(a and b) or c
BOTH a b , OR, c , True.
:
a and (b or c)
True, a , b OR c .
"", , , " " . parens, , . :
if (a and b) or c:
,
if a and b or c:
( ), :
if some_long_identifier and some_other_long_identifier or \
some_third_long_identifier_on_another_line:
Python PEP8. PEP8 , (: parens, ), .
:
- 4, 2....
- 100, 3....
- 400, 4....
- - ( 366 ).
- ( 365 ).
: , 4, , 100 400, :
return y % 4 == 0 and not (y % 100 == 0 and y % 400 != 0)