A QA test for a PlayStation 5 system message needs to verify how often a specific character appears in the message text. Given a string and a target character, return the number of exact, case-sensitive occurrences of that character.
Implement count_character(text, target).
text is a string containing the message to inspect.target is a string containing exactly one character, including a space or punctuation mark.text whose character equals target.P and p are different characters.def count_character(text, target):