A cool pythonic way of writing the below,
if A:
return A
else:
return B
is A or B.
It returns:
A if A is truthy
otherwise returns B, regardless of whether B is truthy or falsy.
A cool pythonic way of writing the below,
if A:
return A
else:
return B
is A or B.
It returns:
A if A is truthy
otherwise returns B, regardless of whether B is truthy or falsy.