getting an item's list index

Michael Anckaert xantor at
Sat Apr 19 14:57:45 CEST 2003

Hello all,

I have a list called contents. If one of the elements has the value
"item1" for example, how can I get that elements index?

for item in contents:
	# here I need to get that items index

Michael Anckaert, aka The XanTor
OpenPGP key: F7A6C3AB
Fingerprint: A329 43FC 3953 A944 5DDC  2E05 8E5D AD60 F7A6 C3AB
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: This is a digitally signed message part
URL: <>

More information about the Python-list mailing list