A = X > Y ? X : Y

Moshe Zadka moshez at math.huji.ac.il
Sun Feb 13 01:15:35 EST 2000


On Sun, 13 Feb 2000, Grant Edwards wrote:

> On Tue, 08 Feb 2000 17:04:01 -0800, Curtis Jensen <cjensen at be-research.ucsd.edu> wrote:
> 
> >I fear that this question has already been asked, 
> 
> Yes, it has.
> 
> >but is there and
> >equivalant one line command that is equivalant to the C command:
> >
> >a = x > y ? x : y
> 
> Possibly.
> 
> Generally this question is answered with at least a half-dozen
> or so one-line code examples -- almost all of which somebody
> will claim are wrong in one respect or another.  While there
> may exist an equivalent chunk of Python code, the practical
> answer seems to be that there isn't a _good_ (readable and
> obviously correct) way to do this with one line of Python code.
> 
> -- 
> Grant Edwards                   grante             Yow!  I'm in direct contact
>                                   at               with many advanced fun
>                                visi.com            CONCEPTS.
> -- 
> http://www.python.org/mailman/listinfo/python-list
> 

--
Moshe Zadka <mzadka at geocities.com>. 
INTERNET: Learn what you know.
Share what you don't.





More information about the Python-list mailing list