.123 is converted to 0.123 as a string so my count comes out at (0,0,1) instead of (0,0,0). I need to ignore that leading 0 but I can't figure out how.
def digit_count(n):
n=str(int(n))
even_count=0
odd_count=0
zero_count=0
for i in n:
if int(i)%10 ==0:
zero_count +=1
elif int(i) % 2 ==0:
even_count += 1
elif int(i) %2 !=0:
odd_count +=1
return(even_count,odd_count,zero_count)
One hacky solution: