Mega Code Archive

 
Categories / Python / List
 

List index(x)

# Return the index in the list of the first item whose value is x. It is an error if  # there is no such item.  a = [66.25, 333, 333, 1, 1234.5] print a.index(333)