python 中switch的实现
时间:2007-09-20 来源:panix
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:
def a(s):
eg:
>>switch('1') |