Back to problems

Implement two string utility functions

Algorithm · xAI · Easy

Write two Python functions as described below. 1. Count Occurrences of a Character Implement number_of_character(string, char), which returns how many times char appears within string. The comparison must respect letter case, so 'A' and 'a' are treated as different characters. The input string may contain letters, digits, spaces, and punctuation. Explanation: s occurs four times in Mississippi. Explanation: The lowercase letter p appears twice: once in Piper and once at the…

Checking your access…