input: Write a function to generate a list of all prime numbers between 1 and a given number n. Return the list of prime numbers. If n is less than 2, return an empty list.
  
  def generate_prime_numbers(n):
      if n < 2:
          return []
      prime_list = [True] * (n + 1)
      p = 2
      while p * p <= n:
          if prime_list[p]:
              for i in range(p * p, n + 1, p):
                  prime_list[i] = False
          p += 1
      primes = [p for p in range(2, n + 1) if prime_list[p]]
      return primes
  
  assert generate_prime_numbers(10) == [2, 3, 5, 7]
  assert generate_prime_numbers(2) == [2]
  assert generate_prime_numbers(1) == []
  assert generate_prime_numbers(20) == [2, 3, 5, 7, 11, 13, 17, 19]
  assert generate_prime_numbers(0) == []
output: def generate_prime_numbers(n):
      if n < 2:
          return []
      prime_list = [True] * (n + 1)
      p = 2
      while p * p <= n:
          if prime_list[p]:
              for i in range(p * p, n + 1, p):
                  prime_list[i] = False
          p += 1
      primes = [p for p in range(2, n + 1) if prime_list[p]]
      return primes