input: Write a function to rewrite the given code snippet to find prime numbers using Python. The function should take an integer 'n' as input and print all prime numbers from 2 to n. If 'n' is less than 2, the function should print an empty line. The function should use a loop to check each number in the range to determine if it is prime based on the provided logic.
  
  def find_primes(n):
      # Function to determine if a number is prime
      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
      
      # Iterate from 2 to n
      for num in range(2, n + 1):
          # Check if the number is prime
          if is_prime(num):
              print(num)
  
  # Test cases
  find_primes(10)  # Expected output: 2 3 5 7
  find_primes(0)  # Expected output: (empty line)
  find_primes(-5)  # Expected output: (empty line)
  find_primes(20)  # Expected output: 2 3 5 7 11 13 17 19
output: def find_primes(n):
      def is_prime(num):
          for i in range(2, int(num ** 0.5) + 1):
              if num % i == 0:
                  return False
          return True
      
      if n < 2:
          print()
      else:
          for num in range(2, n + 1):
              if is_prime(num):
                  print(num)