&'daand'in yaptığını yapar ama short-circuit davranışı göstermez.
(2 == 2) & (3 == 3)True
(5 < 3) & print("hey")hey
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-2-26ebba7ba675> in <module>
----> 1 (5 < 3) & print("hey")
TypeError: unsupported operand type(s) for &: 'bool' and 'NoneType'
5 < 3 and print("hey")karşılaştırması yaptığımızda hata almıyorken5 < 3 & print("hey")'de hata alıyoruz.andboolean ile NoneType karşılaştırırken hata vermezken,&hata veriyor
|'daor'un yaptığını yapar ama short-circuit davranışı göstermez.
(2 == 2) | (3 < 3)True
(5 > 3) or print("hey")True
(5 > 3) | print("hey")hey
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-7-b932c1e836d4> in <module>
----> 1 (5 > 3) | print("hey")
TypeError: unsupported operand type(s) for |: 'bool' and 'NoneType'
5 < 3 or print("hey")karşılaştırması yaptığımızda hata almıyorken5 < 3 | print("hey")'de hata alıyoruz.orboolean ile NoneType karşılaştırırken hata vermezken,|hata veriyor