On Fri, 1 Apr 2005 08:24:42 +0100 (BST), praba kar <[EMAIL PROTECTED]> wrote:
>Dear All, > I am new to Python. I want to know how to >work with ternary operator in Python. I cannot >find any ternary operator in Python. So Kindly >clear my doubt regarding this > > > >__________________________________ >Yahoo! Messenger >Show us what our next emoticon should look like. Join the fun. >http://www.advision.webevents.yahoo.com/emoticontest I've used boolean opperations to do it. result = (v == value) * first + (v != value) * second Same as: if v == value: result = first else: result = second Ron -- http://mail.python.org/mailman/listinfo/python-list