How to count digits, letters, spaces for a string in Python?
Following code replaces any nun-numeric character with '', allowing you to count number of such characters with function len.
import relen(re.sub("[^0-9]", "", my_string))
Alphabetical:
import relen(re.sub("[^a-zA-Z]", "", my_string))
More info - https://docs.python.org/3/library/re.html