Im trying to implement switch-case statement in Python. I need help because this print nothing on console. I want to trigger some functions with this switch.
def do_something():
print("do")
def take_something():
print("take")
switch = {
"do": do_something,
"take": take_something
}
def execute_command(command):
switch.get(command, lambda: print("Invalid command!"))
execute_command(input())