1# alphabets list
2alphabets = ['a', 'e', 'i', 'o', 'g', 'l', 'i', 'u']
3
4# index of 'i' in alphabets
5index = alphabets.index('i') # 2
6print('The index of i:', index)
7
8# 'i' after the 4th index is searched
9index = alphabets.index('i', 4) # 6
10print('The index of i:', index)
11
12# 'i' between 3rd and 5th index is searched
13index = alphabets.index('i', 3, 5) # Error!
14print('The index of i:', index)
1# Find index position of first occurrence of 'Ok' in the list
2indexPos = listOfElems.index('Ok')
3
4print('First index of element "Ok" in the list : ', indexPos)
5
1#Example List
2list = ['apples', 'bannas', 'grapes']
3#Use Known Entites In The List To Find The Index Of An Unknown Object
4Index_Number_For_Bannas = list.index('apples')
5#Print The Object
6print(list[Index_Number_For_Bannas])
7