Skip to main content

Python program to count words in your paragraph/txt

 First input the txt or easy in which you want to count word then input the word you want to count

x = input('input the paragraph: ')
y = input('input the word you want to count: ')
print(x.count(y))

Comments