index of min element of sequence

Paul Rubin http
Mon Jan 21 16:53:03 EST 2008


John Machin <sjmachin at lexicon.net> writes:
> >>> from itertools import count, izip
> >>> min(izip(seq, count()))
> (7, 3)

Serves me right for cutting and pasting.

   minvalue, minindex = min(izip(seq, count()))



More information about the Python-list mailing list