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
1my_string = "Hello World!"
2
3my_string.index("l") # outputs 2
4# this method only outputs the index of the first "l" value in the string/list
11) how to find index of a word in a string:
2 my_string = "Hello World!"
3
4 my_string.index("l")
5
62) how to find the first occurance of a word in a string:
7 print(verse.index('and'))
8
9
10 3)how to find the last occurance of a word in a string:
11 print(verse.rindex('you'))
12
1animals = ['cat', 'dog', 'rabbit', 'horse']
2
3# get the index of 'dog'
4index = animals.index('dog')
5
6
7print(index)
8
9# Output: 1
1# Make the list
2list = ['bananas', 'apples', 'watermellon']
3# Print the word apples from the list
4print(list[1])