MRAB wrote:
> Tim Peters wrote:
> > [MRAB]
> > > Some time after reading about Python 2.5 and how the built-in functions
> > > 'min' and 'max' will be getting a new 'key' argument, I wondered how
> > > they would treat those cases where the keys were the same, for example:
> > >
> > > L = ["four",
[MRAB]
>>> Some time after reading about Python 2.5 and how the built-in functions
>>> 'min' and 'max' will be getting a new 'key' argument, I wondered how
>>> they would treat those cases where the keys were the same, for example:
>>>
>>> L = ["four", "five"]
>>> print min(L, key = len), max(L, ke
Tim Peters wrote:
> [MRAB]
> > Some time after reading about Python 2.5 and how the built-in functions
> > 'min' and 'max' will be getting a new 'key' argument, I wondered how
> > they would treat those cases where the keys were the same, for example:
> >
> > L = ["four", "five"]
> > print min(L,
[MRAB]
> Some time after reading about Python 2.5 and how the built-in functions
> 'min' and 'max' will be getting a new 'key' argument, I wondered how
> they would treat those cases where the keys were the same, for example:
>
> L = ["four", "five"]
> print min(L, key = len), max(L, key = len)
>
>
Hi,
Some time after reading about Python 2.5 and how the built-in functions
'min' and 'max' will be getting a new 'key' argument, I wondered how
they would treat those cases where the keys were the same, for example:
L = ["four", "five"]
print min(L, key = len), max(L, key = len)
The result is: