find index of array python code example
Example 1: python find index by value
>>> ["foo", "bar", "baz"].index("bar")
1
Example 2: find an index of an item in a list python
list = ['apples', 'bannas', 'grapes']
Index_Number_For_Bannas = list.index('apples')
print(list[Index_Number_For_Bannas])
Example 3: get index of item in list
list.index(element, start, end)
Example 4: python, list, index function
vowels = ['a', 'e', 'i', 'o', 'i', 'u']
index = vowels.index('e')
print('The index of e:', index)
index = vowels.index('i')
print('The index of i:', index)