Question: Write a Python function that returns the number of occurrences of a given character in a string using the following header: count(str, char ).This function
Write a Python function that returns the number of occurrences of a given character in a string using the following header: count(str, char).This function does not display any output. It just returns a value to be displayed in the main function.If the character does not exist, return -999.In your main function, when you call this function and the character does't exist in the string, issue a message that the character does not exist in the string.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
