input: Write a python function to check if a number is prime and use it to print all prime numbers from 1 to a given limit.
  assert is_prime(2) == True
  assert is_prime(4) == False
  assert is_prime(13) == True
output: def is_prime(n):
      if n <= 1:
          return False
      if n == 2:
          return True
      if n % 2 == 0:
          return False
      max_divisor = int(n**0.5) + 1
      for d in range(3, max_divisor, 2):
          if n % d == 0:
              return False
      return True
  
  def print_primes_up_to(limit):
      for num in range(1, limit + 1):
          if is_prime(num):
              print(num)