input: Write a python function to generate prime numbers up to a given upper limit and return them as a list.
  assert prime_numbers(10) == [2, 3, 5, 7]
  assert prime_numbers(20) == [2, 3, 5, 7, 11, 13, 17, 19]
  assert prime_numbers(1) == []
output: def prime_numbers(upper_limit):
      if upper_limit < 2:
          return []
      primes = []
      for num in range(2, upper_limit + 1):
          is_prime = True
          for i in range(2, int(num ** 0.5) + 1):
              if num % i == 0:
                  is_prime = False
                  break
          if is_prime:
              primes.append(num)
      return primes