try this with map and lambda
a= "a12345"
sum(list(map(lambda x:1 if x.isdigit() else 0,set(a))))
it will give you count of digit in string
explanation:
set(a) --convert string into unique item (because map function take an iterator or list for mapping it to a function )
lambda x:1 if x.isdigit() else 0
this lambda function help us to find if it digit then it will return 1 and if not it will return 0
list(map(lambda x:1 if x.isdigit() else 0,set(a)))
this will return somthing like this [0,1,1,1,1,1]
sum([0,1,1,1,1,1])
this will sum all the value in list and in this way you find the count