Function to calculate and return the reverse of the number
def reverse ( num ) : NEW_LINE INDENT rev = 0 ; NEW_LINE while ( num > 0 ) : NEW_LINE INDENT r = int ( num % 10 ) ; NEW_LINE rev = rev * 10 + r ; NEW_LINE num = num // 10 ; NEW_LINE DEDENT return rev ; NEW_LINE DEDENT