New user's initial thoughts / criticisms of Python

rusi rustompmody at
Sat Nov 9 16:38:49 CET 2013

On Saturday, November 9, 2013 6:38:25 PM UTC+5:30, John von Horn wrote:
> Another useful tool in the programmer's toolbox

> Select DayofWeek

> 	case "mon"

> 	...

> end select

You can typically write this in python as a dictionary

cases = {"mon": do_mon-action, 
         "tue", do_tue_action,
combined with an 'interpreter'

Some variants:
Need a default?
cases.get(DayofWeek, do_default_action)()

Sometimes nicer to pass some parameters:

More information about the Python-list mailing list