how to find index position in python code example
Example 1: get index of list python
list.index(element)
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: find index of elem list python
indexPos = listOfElems.index('Ok')
print('First index of element "Ok" in the list : ', indexPos)
Example 4: find index of elem list python
First index of element "Ok" in the list : 1