.. ot-exercise:: python.exercises.legacy.for_primeness :dependencies: python.exercises.legacy.while_primeness, python.basics.python_0220_for, python.basics.python_0225_range .. include:: Exercise: Primeness (``for``) ============================= .. sidebar:: **See also** * :doc:`/trainings/material/soup/python/basics/python_0139_commandline_argv/topic` * :doc:`/trainings/material/soup/python/basics/python_0150_datatypes_overview/topic` ("Datatype Conversions") * :doc:`/trainings/material/soup/python/basics/python_0220_for/topic` * :doc:`/trainings/material/soup/python/basics/python_0225_range/topic` Convert the program from exercise :doc:`while_primeness` as follows. * Use a ``for`` loop instead of a ``while`` loop * Use the ``range()`` function to specify the range of divisor candidates Compare both ``while`` and ``for`` solutions. Which one appears more readable?