input: Write a python function to get a list of prime numbers up to a given number.
  assert getPrimeList(10) == [2, 3, 5, 7]
  assert getPrimeList(20) == [2, 3, 5, 7, 11, 13, 17, 19]
  assert getPrimeList(30) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29]
output: def getPrimeList(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
  
      return [x for x in range(2, n + 1) if is_prime(x)]