List index(x) : List Index « List « Python






List index(x)

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)

           
       








Related examples in the same category

1.Searching ListsSearching Lists