I've tried this for hours now and I keep on getting error. Can someone please code this for me.
Write a function called count_occurrences that takes two strings. The second string should only be one character long. The function should return how many times the second string occurs in the first string.
You will need:
A function declaration for the function count_occurrences, with parameters.
A for loop.
An if statement.
A return statement.
Enter the two strings as parameters to your function.