What is the meaning of the following statement in python:
x = variable_1 or 0
variable_1 is an object. What value does x
variable_1
x
x will be 0 if variable_1 evaluates as false, otherwise it will be variable_1
0
>>> 'abc' or 0 'abc' >>> '' or 0 0 >>> ['a', 'b', 'c'] or 0 ['a', 'b', 'c'] >>> [] or 0 0