I have a very long conditional statement for deciding what action to take for a pair of variables a and b.
action = 0 if (a==0) else 1 if (a>1 and b==1) else 2 if (a==1 and b>1) else 3 if (a>1 and b>1) else -1
While it is nice with the compactness (in lines;) ) of this statement, it must exist a more elegant way to do this?