halterman / PythonBook-SourceCode

Python source code for the Fundamentals of Python Programming by Richard Halterman
http://python.cs.southern.edu/pythonbook/pythonbook.pdf
39 stars 24 forks source link

Simple indention error - Page 147 #2

Open peterdcasey opened 5 years ago

peterdcasey commented 5 years ago

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