Python if else one liner
Instead of:
def func(x):
if x == 0:
return "something"
else:
return "something else"
Just do this:
def func(x):
return "something" if x == 0 else "something else"
Nice to know and saved 3 lines of code!-)