Exercise: Primeness (for)

Convert the program from exercise Exercise: Primeness (while) 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?