A = X > Y ? X : Y

bjorn bjorn at roguewave.com
Tue Feb 8 20:45:10 EST 2000


Ben Wolfson wrote:

> On Wed, 09 Feb 2000 01:15:11 GMT, cjc26 at nospam.cornell.edu (Cliff Crawford)
> wrote:
>
> >Pada Tue, 08 Feb 2000 17:04:01 -0800, Curtis Jensen bilang:
> >| I fear that this question has already been asked, but is there and
> >| equivalant one line command that is equivalant to the C command:
> >|
> >| a = x > y ? x : y
> >
> >a = (x > y and [x] or [y])[0]
>
> Isn't this actually wrong?

wrong to use? ... certainly.  It is semantically equivalent though.
--bjorn







More information about the Python-list mailing list