I want to implement a code in Python but I need to implement a switch case. I saw this online (a standard example):
def switch_demo(argument):
switcher = {
1: "January",
2: "February",
3: "March",
4: "April",
5: "May",
6: "June",
7: "July",
8: "August",
9: "September",
10: "October",
11: "November",
12: "December"
}
print switcher.get(argument, "Invalid month")
But I need something different. I don't want to display some strings but to execute some commands, like:
switch(button) { // this is a code for C structure
case 1: do some things ( not just display text)
case 2: do some things ( not just display text)
And so on. Can you please give me an example of how this structure is supposed to look?