input: Write a function to print all prime numbers between 1 and a given number n. The function should use an array to mark prime numbers and print them.
  def print_primes(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
      for p in range(2, n):
          if prime_list[p]:
              print(p)
  
  assert print_primes(10)
  assert print_primes(20)
  assert print_primes(0)
  assert print_primes(1)
  assert print_primes(2)
output: def print_primes(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
      for p in range(2, n):
          if prime_list[p]:
              print(p)