newbie: find position of item in a list

Erik Max Francis max at alcyone.com
Thu Oct 3 04:54:17 EDT 2002


Alexander Eisenhuth wrote:

> l.find('b') doesn't exist ...

Indeed, the .find method is only present in strings, not lists.  The
distinction between .find and .index is subtle but important:  L.index
looks for elements, but S.find looks for substrings.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ God will forgive me; that's his business.
\__/ Heinrich Heine
    Erik Max Francis' bookmarks / http://www.alcyone.com/max/links/
 A highly categorized list of Web links.



More information about the Python-list mailing list