Manipulating Strings

Hi, I’m having a problem with this question. So please help me try to solve it.

Write a script that counts and displays the number of occurrences of a specified word in a given excerpt. The script should request two input values from the user, that is, the excerpt and the word to search for. You can assume that the word will not occur as a substring in other words.

Hey Mritunjay,

Thanks for reaching out. The issue here is that your final print statement does not match the expected output. You have a typo in “occurences” and are missing the quotes around the searched word.

If you change your final line to:

print(f"There are {count} occurrences of '{search}' in the sentence.")

it will pass the check.

Let me know if you have any questions!