Find the location of a word in a string

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
  1. Take a string as input.
  2. Spit the string using Split() to convert it into a list.
  3. From the list use index() function to find the index of a word in the given string.
  4. Print the output.

Output : 

convert numeric words to numbers.

count occurrences of a word in a string.

Leave a Comment