I know Java and C and I used to use Switch statements, but there aren't in python.
I see many ways of use if-elif-else to remplace, but any that remplace completly.
Example of code that I want remplace.
switch(expression) {
case a:
doA();
case b:
doB();
case c:
doC();
break;
case d:
case e:
doDE()
break;
case f:
case g:
doFG():
case h:
doH();
break;
case i:
doI();
default:
foo();
break;
}
As you can see not all case are follow by break, and there is code between some cases that only executed with one case, but there is also common code that is executed in both case.
I see a many ways, but any that allow this at same time. And I think this is the real diference between if-elif-else, and switch-case.
So there is any way of do this will be great, or it's only posible with repeted functions calls and complex if with all posibilities?.
Thank you.