Let’s say I have code like this:
if something == 0:
return something
if something_else = x:
return something_else
And to not make mess here let’s say I have 10 more of this ifs. Do I have to do it like this or there is faster and less messy method? Thanks.
Dictionary is the answer
Values may be even reference to functions, and your answer is