Unit 3 Task 14 - Solution

Learn to code with step-by-step lessons. A place for students to work through programming fundamentals and build skills.

Solution - Task 14: Letter frequency

← Back to task


One possible program:

text = input("Word: ").strip().lower()
frequency = {}

for char in text:
    frequency[char] = frequency.get(char, 0) + 1

for char in frequency:
    print(char, ":", frequency[char])