python switch statement using dictionary