input: Write a function to implement a prime number sieve in Python that returns a list of all prime numbers up to a given number n.
  
  def primeSieve(n): 
      prime_list = [True for i in range(n+1)] 
      p = 2
      while (p * p <= n): 
          if (prime_list[p] == True): 
              for i in range(p * 2, n+1, p): 
                  prime_list[i] = False
          p += 1
      primes=[] 
      for p in range(2, n): 
          if prime_list[p]: 
              primes.append(p) 
      return primes
  
  print(primeSieve(10))  # [2, 3, 5, 7]
  print(primeSieve(100))  # [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]
  print(primeSieve(0))  # []
  print(primeSieve(1))  # []
  print(primeSieve(2))  # []
  print(primeSieve(3))  # [2]
  
output: def primeSieve(n): 
      if n < 2:
          return []
      prime_list = [True for i in range(n+1)] 
      p = 2
      while (p * p <= n): 
          if (prime_list[p] == True): 
              for i in range(p * 2, n+1, p): 
                  prime_list[i] = False
          p += 1
      primes = [p for p in range(2, n) if prime_list[p]]
      return primes