Back to Lesson
Frequency Counter
Build a character distribution map.
Instructions
- Given.
text = "abracadabra" - Create an empty dictionary.
counts = {} - Iterate across every character in the string. For each character, increase its count in the dictionary by 1. Use themethod to supply a default of 0.
.get() - Print the finalobject.
counts
main.py
main.py
Ctrl + Enter