inline if statement python return 1

inline if statement python return

if x is None: return None

Here is what the above code is Doing:
1. If x is None, return None.
2. If x is not None, return x.

The above code is equivalent to:

def identity(x):
return x

Similar Posts