0

does python support switch or case statement in python?

13th Dec 2018, 3:42 PM
Shivendra Kumar
Shivendra Kumar - avatar
5 odpowiedzi
+ 6
No. If you want to use switch/case, you use a dict instead.
13th Dec 2018, 4:00 PM
HonFu
HonFu - avatar
+ 1
Shivendra Kumar Please ask different questions on separate posts. Read the rules and guidelines of the forum here: https://www.sololearn.com/discuss/1316935/?ref=app
13th Dec 2018, 7:15 PM
Diego
Diego - avatar
0
why cannot lambda forms in python contain statements?
13th Dec 2018, 6:52 PM
Shivendra Kumar
Shivendra Kumar - avatar
0
how will you check in a string that all characters are alphanumeric?
13th Dec 2018, 6:54 PM
Shivendra Kumar
Shivendra Kumar - avatar
0
Shivendra Kumar , Python 3.10 supports the match case syntax. Sololearn uses Python 3.9.16 though. Try it somewhere else. https://peps.python.org/pep-0636/
14th Nov 2023, 1:42 AM
Rain
Rain - avatar