input: Write a function to reverse an integer.
  assert reverse_integer(12345) == 54321
  assert reverse_integer(987654321) == 123456789
  assert reverse_integer(1000) == 1
output: def reverse_integer(n):
      reversed_n = 0
      while n > 0:
          reversed_n = reversed_n * 10 + n % 10
          n = n // 10
      return reversed_n