Python or Keyword
Python OR is a logical operator keyword. The OR operator returns True if at least one of the operands becomes to be True.
- In Python or operator does not return True or False.
- The or operator in Python returns the first operand if it is True else the second operand.
Python OR Keyword Truth Table
In python or keyword works in two main situations of Boolean context :
In the if statement python uses the or operator to connect the conditions in one expression.
a is greater than b
Another Statement of the Boolean context where you use the python or operator is while loop. By using or in the loop’s header, you can test several conditions and run the body until all the conditions evaluate to false.
Current Letter : g
Short-circuit evaluation is the semantics of some Boolean operators in programming in which the second argument is evaluated only if the first argument does not suffice to determine the output. When the first argument is true, the overall output becomes true.
Please Login to comment...