+ 2

Can we use switch case in Python programming language...If yes the please describe its Implementation

Switch case in Python

21st Jan 2018, 2:40 PM
Yash Raghava
Yash Raghava - avatar
2 Réponses
+ 3
but you could do workaround by using dictionary like def f(x): return { 'a': 1, 'b': 2, }[x]
21st Jan 2018, 3:06 PM
code learner
code learner - avatar
+ 4
there is no switch case in python
21st Jan 2018, 3:05 PM
code learner
code learner - avatar