input: Write a function to find the nth prime number.
  assert nth_prime(1) == 2
  assert nth_prime(5) == 11
  assert nth_prime(10) == 29
output: def nth_prime(n):
      if n == 1:
          return 2
      primes = [2]
      num = 3
      while len(primes) < n:
          for prime in primes:
              if num % prime == 0:
                  break
          else:
              primes.append(num)
          num += 2
      return primes[-1]