About 54 results
Open links in new tab
  1. What is the Python equivalent for a case/switch statement?

    Jul 14, 2012 · Python 3.10.0 provides an official syntactic equivalent, making the submitted answers not the optimal solutions anymore! In this SO post I try to cover everything you might …

  2. Replacements for switch statement in Python? - Stack Overflow

    Sep 13, 2008 · I want to write a function in Python that returns different fixed values based on the value of an input index. In other languages I would use a switch or case statement, but Python …

  3. What is the syntactical equivalent to switch/case in Python?

    Mar 30, 2021 · With Python, there are some differences to note though. Cases don't fall through It's common that languages with switch - case statements execute every case the value …

  4. Есть ли в Python оператор switch case? - Stack Overflow на …

    Столкнулся с тем, что требуется реализовать множественное условие, которое в других языках я бы реализовал с помощью конструкции switch-case. В Python мне приходится …

  5. How to use multiple cases in Match (switch in other languages) …

    Oct 20, 2021 · How to use multiple cases in Match (switch in other languages) cases in Python 3.10 Asked 4 years, 2 months ago Modified 2 years, 5 months ago Viewed 131k times

  6. Switch in Python - Stack Overflow

    Jan 17, 2012 · 3 Other ans are suitable for older version of python. For python v3.10+ you can use match/case which is more powerful than general switch/case construct.

  7. menu - Switch-case statement in Python - Stack Overflow

    Mar 15, 2021 · Switch-case statement in Python Asked 4 years, 9 months ago Modified 4 years, 9 months ago Viewed 3k times

  8. Python Match Case (Switch) Performance - Stack Overflow

    Jul 21, 2021 · A while back, I published an article on Medium about Python's match-case performance, analyzing the generated byte code and performing benchmarks and comparisons.

  9. How to use switch in Python? - Stack Overflow

    Sep 20, 2015 · Closed 10 years ago. switch is not inbuilt in Python language so How can i achieve this concept in python for select one case in other language code is :

  10. Using a dictionary as a switch statement in Python

    Feb 23, 2014 · Using a dictionary as a switch statement in Python [duplicate] Asked 11 years, 10 months ago Modified 4 years, 1 month ago Viewed 42k times