Iteration over Lists and Strings

Terry Reedy tjreedy at
Sat Aug 28 11:37:25 CEST 2004

"DeepBleu" <DeepBleu at> wrote in message 
news:cUSXc.56768$xi6.42946 at
> (expected result:

When something does not act as expected, look in the manual or try the 
builtin help facility, which only takes seconds.

>>> help(list.index)
Help on method_descriptor:

    L.index(value) -> integer -- return index of first occurrence of value

dir(object) will give you a list of attributes and methods.   You can look 
up new ones the same way.  In particular, dir(list) and dir(__builtins__).

Terry J. Reedy

More information about the Python-list mailing list