转载自:http://blog.chinaunix.net/uid-1706385-id-2834875.html
There is currently no switch statement in Python. Often this is not a problem and can be handled through a series of if-elif-else statements. However, there are many other ways to handle the deficiency. The following example shows how to create a simple switch statement in Python:
| |
本文介绍了如何在Python中通过if-elif-else语句模拟switch语句的功能,并提供了简单的实现示例。
286

被折叠的 条评论
为什么被折叠?



