Thanks for the example code.
In Python, the
or operator performs a "short-cut" evaluation of expressions. If the operand on the left side of the
or does not evaluate to something that corresponds to
False, then the operation immediately evaluates to the value of the left operand without evaluating the right operand at all.
or has precedence over
== concerning order of operations.
"A" is not a
"A" or "a" evaluates to
"A". Therefore, ...
if char == "A" or "a":
... only executes its block of code if
char == "A" is