xxxxxxxxxx
# To check if a variable is not None:
if x is not None:
# Do something
xxxxxxxxxx
>>> x = None
if x:
print 'if x'
if x is not None:
print 'if x is not None'
xxxxxxxxxx
result = value or "default" # result == "default" if value is any false value (0, [], '', ...)