Knowing an item's location in an array [duplicate]
Use the index()
method on list.
See Finding the index of an item given a list containing it in Python:
>>> ["foo","bar","baz"].index('bar')1
Use the index()
method on list.
See Finding the index of an item given a list containing it in Python:
>>> ["foo","bar","baz"].index('bar')1