$ ./guess_the_languageProblem Solving — fill the blank
Problem Solving — fill the blank · medium · #287

What goes in the blank?

def is_prime(n):
    i = 2
    while i * i ____ n:
        if n % i == 0:
            return False
        i += 1
    return n > 1

Answer: <= (also accepted: <=)

Divisors pair up around the square root, so trial division stops once i * i passes n; < would miss perfect squares like 9.
Play Problem Solving ▸