Popular recipes tagged "language" and "switch"http://code.activestate.com/recipes/tags/language+switch/2016-12-11T16:28:50-08:00ActiveState Code RecipesSimulate C's switch statement (Python)
2016-12-11T16:28:50-08:00Vasudev Ramhttp://code.activestate.com/recipes/users/4173351/http://code.activestate.com/recipes/580730-simulate-cs-switch-statement/
<p style="color: grey">
Python
recipe 580730
by <a href="/recipes/users/4173351/">Vasudev Ram</a>
(<a href="/recipes/tags/c/">c</a>, <a href="/recipes/tags/features/">features</a>, <a href="/recipes/tags/language/">language</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/switch/">switch</a>).
</p>
<p>This recipe shows a Python construct that can behave somewhat like C's switch statement. It is not a perfect one-to-one simulation. But it does have some of the features of the C switch. One feature not supported is the fall-through feature in C's switch.</p>