Exercise: Primeness (for)

  1. Convert the program from exercise Exercises: Primeness (while) as follows.

    • Use a for loop instead of a while loop

    • Use the range() function to specify the range of divisor candidates

  2. Compare both while and for solutions. Which one appears more readable?