+ 1
How to find the index of a an element in the list (python)
2 odpowiedzi
+ 5
list2.index('r')
to find the index of r in list2
+ 3
I am assuming you mean finding the index of an element by name? If yes, there is the index() method
["foo", "bar", "baz"].index("bar")
returns:
1