On Sun, Nov 2, 2008 at 12:33 PM, spir <[EMAIL PROTECTED]> wrote:
> Excuse me for such a stupid question, I just wish to stop and lose my time
> searching for something that maybe simply does not exist.
> I'm looking for the builtin function for sequences that would return a list
> of (index,item) pairs to be used in loops. analog to dict's items()
> function.

IIUC you are looking for enumerate():
http://docs.python.org/library/functions.html#enumerate

The doc page on built-in functions, which contains enumerate(), is
worth skimming or reading. I also recommend the docs on built-in
types, which tell you everything you can do with a list, dict, set,
file, etc:
http://docs.python.org/library/stdtypes.html

Kent
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to