Your search query "linkto%3A%22UsingEnumerate%22" didn't return any results. Please change some terms and refer to HelpOnSearching for more information.
(!) Consider performing a full-text search with your search terms.

Clear message

enumerate is easy to use:

   1 for index, character in enumerate("hello"):
   2   print "#%d: %s" % (index, character)

...which prints out:

#0: h
#1: e
#2: l
#3: l
#4: o

You can use it on just about any iterable sequence.

Unable to edit the page? See the FrontPage for instructions.