Python loops can have an else clause that runs if the loop completes normally (without break):
for n in range(2, 10):
for x in range(2, n):
if n % x == 0:
print(f"{n} = {x} * {n//x}")
break
else:
print(f"{n} is prime")
The else runs only if the inner loop didn't break. If we found a divisor, we break and skip the else. If no divisor found, the else runs.
This is useful for search patterns: "did we find it or not?"