if statement1:
if statement2:
if statement3:
return desired_action
else:
return action3
else:
return action2
else:
return action1
vs: 2.
if not statement1:
return action1
elif not statement2:
return action2
elif not statement3:
return action3
else:
return desired_action
I tend to prefer the second way, but for some reason it seems somewhat.. risky? or unreliable as much as the first method.
Also, do I really need that elif? I return when I reach a certain if. Thank you.
Is there a convention or a standard?