Num-Counter
Sun 29 June 2025
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, {'2 …Category: basics
Read More
