Count rotations which are divisible by 10 | Function to return the count of all rotations which are divisible by 10. ; Loop to iterate through the number ; If the last digit is 0 , then increment the count ; Driver code
def countRotation ( n ) : NEW_LINE INDENT count = 0 ; NEW_LINE while n > 0 : NEW_LINE INDENT digit = n % 10 NEW_LINE if ( digit % 2 == 0 ) : NEW_LINE INDENT count = count + 1 NEW_LINE DEDENT n = int ( n / 10 ) NEW_LINE DEDENT return count ; NEW_LINE DEDENT if __name__ == " _ _ main _ _ " : NEW_LINE INDENT n = 10203 ; NEW_LINE print ( countRotation ( n ) ) ; NEW_LINE DEDENT