input: Write a function to check if a number is a prime number and then print all prime numbers up to a given limit 'n'.
  def is_prime(num):
      # Iterate from 2 to the square root of the number
      for i in range(2, int(num ** 0.5) + 1):
          if num % i == 0:
              return False
      return True
  
  # Function to print all prime numbers up to n
  def print_primes_up_to_n(n):
      # Iterate from 2 to n
      for num in range(2, n + 1):
          # Check if the number is prime
          if is_prime(num):
              print(num)
  
  assert is_prime(2) == True
  assert is_prime(3) == True
  assert is_prime(4) == False
  assert is_prime(5) == True
  
  print_primes_up_to_n(10)  # Should print "2 3 5 7"
output: def is_prime(num):
      for i in range(2, int(num ** 0.5) + 1):
          if num % i == 0:
              return False
      return True
  
  def print_primes_up_to_n(n):
      for num in range(2, n + 1):
          if is_prime(num):
              print(num)