Почему возникает особенность сравнения в Python?


python 
>>> a: int = 100
>>> b: int = 200
>>> bin(a)
'0b1100100'
>>> bin(b)
'0b11001000'
>>> a & b  
64 >>> a and b 200 >>> b and a 100
Ответы

The expression x and y first evaluates x; if x is false, its value is returned; otherwise, y is evaluated and the resulting value is returned.

The expression x or y first evaluates x; if x is true, its value is returned; otherwise, y is evaluated and the resulting value is returned.

Ссылки


Возможно будут интересны и другие вопросы
© RemiZOffAlex