What is the syntax to return the index of a value in a list?

<list name>.index(<search value>)
#example
>>> fruits=['apple','cherry','strawberry','cherry']

>>> fruits.index('strawberry')
2
>>> fruits.index('cherry')
1

 

Advertisements