min, max with position

Greg Ewing greg.ewing at canterbury.ac.nz
Sat Jun 4 19:52:45 EDT 2022


On 5/06/22 10:07 am, dn wrote:
> On 05/06/2022 09.50, Chris Angelico wrote:
>>>>> min(enumerate(l), key=lambda x: x[1])
>> (0, 1.618033)
> 
> But, but, but which of the above characters is an 'el' and which a 'one'???
> (please have pity on us old f...s and the visually-challenged!)
> 

ell = l
one = 1
min(enumerate(ell), key=lambda x: x[one])

Hope that clears it up!!!!!11!one!ell

-- 
Greg


More information about the Python-list mailing list