Function to find the number of digits in the integer
def digitsCount ( n ) : NEW_LINE INDENT length = 0 ; NEW_LINE while ( n > 0 ) : NEW_LINE INDENT length += 1 ; NEW_LINE n //= 10 ; NEW_LINE DEDENT return length ; NEW_LINE DEDENT