Iru's message tools need a compact character-frequency summary for analyzing user-entered text. Given a message, count each character and return the results ranked from most frequent to least frequent.
Implement character_frequencies(text, case_sensitive, include_whitespace).
text is a string.case_sensitive is a Boolean. If False, convert alphabetic characters to lowercase before counting.include_whitespace is a Boolean. If False, ignore whitespace characters such as spaces, tabs, and newlines.[character, count].Character comparisons use Python string characters, so punctuation, digits, and Unicode characters are valid inputs.
def character_frequencies(text, case_sensitive, include_whitespace):