Which of the following code snippets would work as the best switch-case equivalent?
Correct Answer: case_dict = { 'a': 1, 'b': 2, } def switch(x): return case_dict.get(x, 0)
Explanation:
Note: This Question is unanswered, help us to find answer for this one
More Python MCQ Questions