2 ответов
+ 4
James Clark I. Vinarao there has been several proposals for switch case in python but there are several reasons as to why switch case failed in testing.
Here is the pep notes regarding switch case and alternatives
https://www.python.org/dev/peps/pep-3103/
+ 5
Python doesn't have a switch statement. Although, you can use dictionary mapping:
https://www.geeksforgeeks.org/switch-case-in-python-replacement/