Chris Smith <[EMAIL PROTECTED]> wrote: >What I really want to do is take four lines of conditional, and put >them into one, as well as blow off dealing with a 'filler' variable: > >return "the answer is " + "yes" if X==0 else "no"
I would write this as: return "the answer is " + ("yes" if X==0 else "no") Adding the parens makes it clearer. I've long since given up trying to remember operator precedence (except for the most basic like multiplication is stronger than addition) and use parens with wild abandon. -- http://mail.python.org/mailman/listinfo/python-list