input: Write a function to check if a given number is a prime number using Python. The function should return True if the number is prime and False otherwise. Additionally, write code to print all prime numbers from 2 up to a given number n.
  assert is_prime(5)==True
  assert is_prime(9)==False
  assert is_prime(13)==True
  assert is_prime(1)==False
  
  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 num > 1
  
  # Iterate from 2 to n
  n = 10  # Example value for n
  for num in range(2, n+1):
      # Check if the number is prime
      if is_prime(num):
          print(num)
output: def is_prime(num):
      for i in range(2, int(num ** 0.5) + 1):
          if num % i == 0:
              return False
      return num > 1