char_frequency(s) that returns a dictionary mapping each character in s to how many times it appears, built by iterating over the string with a for loop (do not use collections.Counter).char_frequency("banana"){"b": 1, "a": 3, "n": 2}Counts of each letter.
Start with an empty dict; for each character, increment its count or initialize it to 1.
`counts[ch] = counts.get(ch, 0) + 1` is a concise pattern.