In this program, we will take a string as input and find the location of a word in a string.
Steps to solve the program
- Take a string as input.
- Spit the string using Split() to convert it into a list.
- From the list use index() function to find the index of a word in the given string.
- Print the output.
Output :