Day 9Most Common Letter
Mediumstringsdictionaries
Write most_common_letter(text) that returns the letter that appears most often in text, as a lowercase letter.
Upper and lower case count as the same letter. Spaces, digits and punctuation are ignored.
Examples
Example 1
>>> most_common_letter("Hello World") "l"
Example 2
>>> most_common_letter("aabbb") "b"
Good to know
- If several letters are tied, return the one that comes first in the alphabet.
textalways contains at least one letter.
Run examples checks the 2 examples above. Submit runs all 7 tests, including hidden edge cases, and marks the challenge solved.