Minor code clean-up for the factor() recipe (GH-108114)

diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst
index 730736b..d0bb469 100644
--- a/Doc/library/itertools.rst
+++ b/Doc/library/itertools.rst
@@ -1048,9 +1048,7 @@
        # factor(1_000_000_000_000_007) --> 47 59 360620266859
        # factor(1_000_000_000_000_403) --> 1000000000000403
        for prime in sieve(math.isqrt(n) + 1):
-           while True:
-               if n % prime:
-                   break
+           while not n % prime:
                yield prime
                n //= prime
                if n == 1: