Number Counter

from collections import defaultdict
counter = defaultdict(int)
content = "one 2 1 three 4 2 1 7 6 six 8 9 8"
content
'one 2 1 three 4 2 1 7 6 six 8 9 8'
for c in content.split(' '):
    if(c.isdigit()):
        counter[c] += 1
counter
defaultdict(int, {'1': 2, '2': 2, '4': 1, '6': 1, '7': 1, '8': 2, '9': 1})
for k, v in counter.items():
    print(k, "==>", v)
2 ==> 2
1 ==> 2
4 ==> 1
7 ==> 1
6 ==> 1
8 ==> 2
9 ==> 1