newbie seeks advise.

Erik Max Francis max at
Fri Sep 20 10:28:22 CEST 2002

Gerhard Häring wrote:

> If you want to program a max() function yourself, you can convert the
> tuple to a list using list(data), then sorting it, then finding the
> largest element yourself.

Or just scan the list, keeping track of the largest element you've seen
so far.  When you're done, the largest one you've seen is the largest in
the list.  This has better performance than sorting.

 Erik Max Francis / max at /
 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ He who has a _why_ to live can bear with almost any _how_.
\__/ Friedrich Nietzsche
    REALpolitik /
 Get your own customized newsfeed online in realtime ... for free!

More information about the Python-list mailing list