max value in list
Terry Reedy
tjreedy at udel.edu
Wed May 12 11:16:17 EDT 2004
"C GIllespie" <csgcsg39 at hotmail.com> wrote in message
news:c7te26$8q1$1 at ucsnew1.ncl.ac.uk...
> Dear all,
>
> I have a few lists. What's the best way of finding the maximum number of
all
> the lists.
>
> For example,
>
> [2,3,4],[1,2,3],[4,7]
>
> The max is 7.
Sidestepping 'best' which may depend on context, a general 'good' way is
>>> lists = [2,3,4],[1,2,3],[4,7]
>>> max([max(l) for l in lists])
7
Terry J. Reedy
More information about the Python-list
mailing list