Simple question on indexing

Tartifola tartifola at gmail.com
Fri Dec 1 11:21:46 EST 2006


Hi,
I would like to obtain the position index in a tuple when an IF
statement is true. Something like

>>>a=['aaa','bbb','ccc']
>>>[ ??? for name in a if name == 'bbb']
>>>1

but I'm not able to find the name of the function ??? in the python documentation, any help?
Thanks




More information about the Python-list mailing list