list.index(element) allows you to get the index of the specified element in a list. However, you cannot get the index using a function.
list.index(element)
To get the index of an element in a list using a function, use the find_index method instead.
find_index
Link to pydash.
Google Colab notebook of the code above.