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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!