There is an indention error in the code just over halfway down page 147. The code is not in the listing but below it. The code after the while should be indented.
trial_factor = 2
while trial_factor < value:
if value % trial_factor == 0:
is_prime = False # Found a factor
break # No need to continue; it is NOT prime
trial_factor += 1 # Try the next potential factor
There is an indention error in the code just over halfway down page 147. The code is not in the listing but below it. The code after the while should be indented.