Skip to content
This repository was archived by the owner on Jul 2, 2024. It is now read-only.

Commit aad52bb

Browse files
committed
Added 'logical disjunction' (or) description
Signed-off-by: Serhii Horodilov <sgorodil@gmail.com>
1 parent 7ed9b43 commit aad52bb

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/basics/bool_logic.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,32 @@ be ``True`` if **both** are true.
157157

158158
.. todo: func_1() and func_2(); 0 and 5
159159

160+
Getting started with ``or`` operator
161+
------------------------------------
162+
163+
With Boolean ``or`` operator, you can connect two Boolean expressions into one
164+
compound expression. This makes ``or`` the **binary** operator. At least one
165+
subexpression must be ``True`` for the compound expression to be considered
166+
``True``, and it doesn't matter which. If both subexpressions are ``False``,
167+
then the expression is ``False``.
168+
169+
.. table:: or operator truth table
170+
:align: center
171+
172+
+---------------+---------------+----------------------------+
173+
| ``operand_1`` | ``operand_2`` | ``operand_1 or operand_2`` |
174+
+===============+===============+============================+
175+
| ``True`` | ``True`` | ``True`` |
176+
+---------------+---------------+----------------------------+
177+
| ``False`` | ``False`` | ``False`` |
178+
+---------------+---------------+----------------------------+
179+
| ``True`` | ``False`` | ``True`` |
180+
+---------------+---------------+----------------------------+
181+
| ``False`` | ``True`` | ``True`` |
182+
+---------------+---------------+----------------------------+
183+
184+
.. todo: default mutable value, e.g. x = x or []
185+
160186
Comparison
161187
==========
162188

0 commit comments

Comments
 (0)