2 ответов
+ 1
You can use the dictionary functions to go the 'elegant' and more readable way, but if/else are okay,too. :)
Look here;
https://jaxenter.com/implement-switch-case-statement-JUMP_LINK__&&__python__&&__JUMP_LINK-138315.html
+ 1
No, Python doesn't have the switch statement. You have to use multiple if/elif/else statements.