Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Exercise: count digits

Create a script called count_digits_in_lists.py that given a list of numbers count how many times each digit appears? The output will look like this:

0  1
1  3
2  3
3  2
4  1
5  2
6  2
7  0
8  1
9  1
  • Use this skeleton
numbers = [1203, 1256, 312456, 98]