12) Write a program to enter the sentence from the user and print how many time the
word ‘is’
appear in the sentence.
sentence = input("Enter a sentence: ")
sentence = sentence.lower()
words = sentence.split()
count_is = words.count('is')
print(f"The word 'is' appears {count_is} time(s) in the sentence.")
Output
Enter a sentence: is their anyone who is not having the invitation
The word 'is' appears 2 time(s) in the sentence.