On Thu, Feb 26, 2009 at 7:11 PM, Anjanesh Lekshminarayanan <m...@anjanesh.net> wrote: > How do I achieve something like this using python ? > spaces = (form.has_key('spaces') ? form.getvalue('spaces') == 1 ? True > : False : False) > > spaces = True if form.getvalue('spaces') == 1 if > form.has_key('spaces') else False else False
That seems to just be an overly complicated way of writing: spaces = bool(form.has_key('spaces') and form.getvalue('spaces') == 1) Cheers, Chris -- Follow the path of the Iguana... http://rebertia.com -- http://mail.python.org/mailman/listinfo/python-list