Learing Python, Newbie question

Klaus Alexander Seistrup nospam2001oct at magnetic-ink.dk
Fri Oct 26 02:06:45 EDT 2001


Johannes Gamperl wrote:

> Do you know if there is a coditional operator in python ( ?: )

The "a ? b : c" that we know from C can be emulated in Python by

	((a and [b]) or [c])[0]


  // Klaus

-- 
 ><>° 	vandag, môre, altyd saam



More information about the Python-list mailing list