Count occurrences of word in a string.

In this program, we will take a string as input and count occurrences of word in a string.

Steps to solve the program
  1. Take a string as input.
  2. Count the occurrences of a specified word in a string using count().
  3. Print the output.

Output :

find the location of a word in a string

find the least frequent character in a string.

Leave a Comment