PEP308 :

Roel Mathys Roel.Mathys at yucom.be
Fri Feb 14 10:32:40 EST 2003


Could this work?


Ternary :

	if x : ( "it 's alright" , "Bye bye" )

would be the same as :

	if x :
		"it 's alright"
	else :
		"Bye bye"



You could also find a solution like this for a switch statement:

Switch statement:

	if x :
		{
		15 	: "it 's alright" ,
		'hello' : "Bye bye"
		}
	else :
		"Default"

would be the same as:

	if x == 15 :
		"it 's alright"
	elif x == 'hello' :
		"Bye bye"
	else :
		"Default"


bye,
rm





More information about the Python-list mailing list