Question: Write a function called count occurrences that takes two strings. The second string should only be one character long. The function should return how
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. Ask the user to input both strings (first the word, and then the letter). Then enter the two strings as parameters to your function.
Step by Step Solution
There are 3 Steps involved in it
Here is a Python function called countoccurrences that takes two strings as input and returns how ma... View full answer
Get step-by-step solutions from verified subject matter experts
