+ 2
Pythin Switch Case
How would i do switch case in Python? I know its not an actual thing but how would you do it in the Python way? Can you give me an example too?
3 odpowiedzi
+ 7
or just use if and elif.
0
You can store function names as values in a dictionary and treat the keys as your cases.
0
Jacob Moriarty ,
Python 3.10 has match case syntax. Sololearn uses Python 3.9.16.
https://peps.python.org/pep-0636/