switch

Chris Rebert clp2 at rebertia.com
Tue Dec 8 20:57:38 EST 2009


On Tue, Dec 8, 2009 at 5:53 PM, hong zhang <henryzhang62 at yahoo.com> wrote:
> Python does not have switch statement. Any other option does similar work?

Yes, a dictionary with functions as values:
http://simonwillison.net/2004/May/7/switch/

Cheers,
Chris
--
http://blog.rebertia.com



More information about the Python-list mailing list