On Jan 22, 7:56 am, Paul Rubin <http://(EMail Removed)> wrote:
> John Machin <(EMail Removed)> writes:
> > s/[1]/[0]/ or more generally:
>
> Oops, got two spellings confused. Originally was going to use
>
> from itertools import count, izip
> min(izip(seq, count()))[1]
>
> but did it with enumerate instead. I don't know which is actually
> faster.
>
> > minindex, minvalue = min(enumerate(seq), key=itemgetter(1))
>
> Cool, I like this best of all. Or alternatively,
>
> minindex, minvalue = min(izip(seq, count()))
Bzzzt #2!
>>> from itertools import count, izip
>>> min(izip(seq, count()))
(7, 3)
