Logical OR Assignment¶
Logical OR assignment operator (||=
) can be used to perform logical OR operation and assign it to a variable.
Syntax
variable ||= expr
Example
a ||= true
b ||= false