input: Write a python function to find the next prime number after a given number.
  assert next_prime(19) == 23
  assert next_prime(10) == 11
  assert next_prime(23) == 29
output: def next_prime(n):
      def is_prime(k):
          if k <= 1:
              return False
          for i in range(2, int(k ** 0.5) + 1):
              if k % i == 0:
                  return False
          return True
  
      candidate = n + 1
      while not is_prime(candidate):
          candidate += 1
      return candidate