This repository was archived by the owner on Jul 2, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,32 @@ be ``True`` if **both** are true.
157
157
158
158
.. todo: func_1() and func_2(); 0 and 5
159
159
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
+
160
186
Comparison
161
187
==========
162
188
You can’t perform that action at this time.
0 commit comments