On Mar 30, 11:40 am, gentlestone <tibor.b...@hotmail.com> wrote:
> Hi, how can I write the popular C/JAVA syntax in Python?
>
> Java example:
>     return (a==b) ? 'Yes' : 'No'
>
> My first idea is:
>     return ('No','Yes')[bool(a==b)]
>
> Is there a more elegant/common python expression for this?

return ('Yes' if a == b else 'No')
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to