input: Write a python function to generate the first 10 prime numbers.
  assert generate_primes(10) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29]
  assert generate_primes(5) == [2, 3, 5, 7, 11]
  assert generate_primes(1) == [2]
output: def generate_primes(n):
      def is_prime(num):
          if num < 2:
              return False
          for i in range(2, int(num ** 0.5) + 1):
              if num % i == 0:
                  return False
          return True
      
      primes = []
      candidate = 2
      while len(primes) < n:
          if is_prime(candidate):
              primes.append(candidate)
          candidate += 1
      return primes