How to extract the same number of characters from multiple strings in python

The string "123904560"
is composed of five strings: "23239504", "2314564", "78349088", "7649643" < five strings. For example, extract 0 appears three times in five strings. 9 appears four times in five strings. Is there a concise method for
, or can you only use traversal

?
Mar.03,2021

you can use Counter

>>> from collections import Counter
>>> s = ['123904560', '23239504', '2314564', '78349088', '7649643']
>>> count = lambda i: Counter(''.join(s)).get(str(i))
>>> count(1)
2
>>> count(0)
4
>>> count(9)
4
>>> 
Menu