&
&'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.
Quiz
Answer the questions to check your understanding.
This lesson includes a short quiz.
Lesson discussion
Swap insights and ask questions about Python Temel
Be the first to start the discussion
Ask a question or share your thoughts about this lesson.