Home Replacements for switch statement in Python?
Reply: 0

Replacements for switch statement in Python?

user352
1#
user352 Published in May 21, 2018, 6:36 pm

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 does not appear to have a switch statement. What are the recommended Python solutions in this scenario?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.532374 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO