input: Write a function to reverse an integer.
  assert reverse_int(123) == 321
  assert reverse_int(100) == 1
  assert reverse_int(-456) == -654
output: def reverse_int(n):
      sign = -1 if n < 0 else 1
      reversed_num = int(str(abs(n))[::-1])
      return sign * reversed_num