input: Write a function to construct a prime number sieve in Python which returns a list of all primes up to a given number. The function should use the Sieve of Eratosthenes algorithm to find the primes.
  assert primeSieve(10) == [2, 3, 5, 7]
  assert primeSieve(20) == [2, 3, 5, 7, 11, 13, 17, 19]
  assert primeSieve(5) == [2, 3, 5]
  assert primeSieve(1) == []
  assert primeSieve(0) == []
output: def primeSieve(n):
      if n < 2:
          return []
      sieve = [True] * (n + 1)
      sieve[0] = sieve[1] = False
      for i in range(2, int(n**0.5) + 1):
          if sieve[i]:
              for j in range(i*i, n + 1, i):
                  sieve[j] = False
      return [i for i in range(2, n + 1) if sieve[i]]