This question is motivated by something I\'ve lately started to see a bit too often, the if..else if..else structure. While it\'s simple and has its uses, somet
if..else if..else
In python, I would write your code as:
actions = { 1: doOne, 2: doTwo, 3: doThree, } actions[i]()