Ternary is easy to use when checking for none-y variables.
>>> x = None
>>> y = 2 if x else 3
>>> y
3
If i want to check for none-ity before i return is there a ternary equivalence to:
def foobar(x):
if x:
return x*x
else:
print 'x is None-y'
Is there something that looks like:
def foobar(x):
return x*x if x else print 'x is None-y'