input: Write a function to rewrite the provided code snippet to find prime numbers using Python. The function should iterate from 2 to n, check for each number if it's prime using the is_prime function, and then print the number if it's prime.
  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
  
      for n in range(2, n+1):
          if is_prime(n):
              print(n)
  assert find_primes(10)
  assert find_primes(20)
  assert find_primes(5)
  assert find_primes(15)
  assert find_primes(1)
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
  
      for n in range(2, n+1):
          if is_prime(n):
              print(n)