In Python we can do this:
if True or blah:
print(\"it\'s ok\") # will be executed
if blah or True: # will raise a NameError
print(\"it\'s not ok\")
It's the way the operators logical operators, specifically or in python work: short circuit evaluation.
To better explain it, consider the following:
if True or False:
print('True') # never reaches the evaluation of False, because it sees True first.
if False or True:
print('True') # print's True, but it reaches the evaluation of True after False has been evaluated.
For more information see the following: