Why this boolean operation produces a bool
:
False and "False" => False
whereas this one produces a str
?
False or "Value" => "Value"
Why this boolean operation produces a bool
:
False and "False" => False
whereas this one produces a str
?
False or "Value" => "Value"
False and "anything" will always result in a boolean False.
When you do False or "anything", the "anything" is considered as boolean True as long as it is not False or equivalent to False (like 0, 0.0, etc), and since 'False or True' is equal to true, it returns True or in your case, the string "anything" equivalent to True.