Skip to content
Code ReadingLetter Count
Predict the Output

Letter Count

How does the dictionary fill up? Write exactly what is printed.
1seen = {}
2for ch in "banana":
3 seen[ch] = seen.get(ch, 0) + 1
4print(len(seen), seen["a"])