[Tutor] dictionary swittching

Erik Price erikprice@mac.com
Tue, 14 May 2002 21:45:29 -0400


On Tuesday, May 14, 2002, at 08:20  AM, dman wrote:

> Hmm, maybe the on-line doc will do a better job of explaining the
> specific semantics of an "if" statement and the meaning of 'elif' and
> 'else'.

How about:

if (condition1):
   execute green code
elif (condition2):
   execute orange code
elif (condition3):
   execute red code
else:
   execute blue code

is equivalent to

if (condition1):
	execute green code
else:
	if (condition2):
		execute orange code
	else:
		if (condition3):
			execute red code
		else:
			execute blue code




Erik