input: Write a python function to find the nth prime number.
  assert nth_prime(1) == 2
  assert nth_prime(2) == 3
  assert nth_prime(3) == 5
  assert nth_prime(10) == 29
  assert nth_prime(100) == 541
output: def nth_prime(n):
      def is_prime(num):
          if num <= 1:
              return False
          if num <= 3:
              return True
          if num % 2 == 0 or num % 3 == 0:
              return False
          i = 5
          while i * i <= num:
              if num % i == 0 or num % (i + 2) == 0:
                  return False
              i += 6
          return True
  
      count = 0
      candidate = 1
      while count < n:
          candidate += 1
          if is_prime(candidate):
              count += 1
      return candidate