Write a program to enter a sentence from the keyboard and count the number of times a particular word occurs in it. for_example enter a sentence:The quick brown for jump over the lazy dog. enter a word to be searched : the output : 2times
Answers
Answered by
1
Answer: Python 3
inputSentence= input('Enter a sentence :').lower()
wordArray = inputSentence.split(' ')
SearchWord = input('Enter word to be searched').lower()
print(wordArray.count(SearchWord))
Explanation:
A python 3 implementation of above question
Similar questions
English,
6 months ago
India Languages,
1 year ago
Math,
1 year ago
English,
1 year ago
History,
1 year ago