input: Write a function to rewrite the provided code snippet to find prime numbers using Python, ensuring that the function definition is named 'is_prime' and iterates from 2 to the square root of the number to check for factors. The function should return False if the number is not prime, and True if it is prime. Use the following assert tests to validate the function.
  assert is_prime(2)==True
  assert is_prime(3)==True
  assert is_prime(4)==False
  assert is_prime(5)==True
  assert is_prime(10)==False
output: def is_prime(n):
      if n <= 1:
          return False
      for i in range(2, int(n**0.5) + 1):
          if n % i == 0:
              return False
      return True