October 2018
Intermediate to advanced
404 pages
8h 50m
English
A for loop doesn't need an incrementor because it builds the range into the condition, as contrasted with a while loop, which only includes a limit beyond which the loop will not run. Using Python notation, the following code shows what happens if you start with an X value of 0 and a range from one to eleven. The preset value of X is not important to the for loop iteration. It applies all values to X that it tests:

We are starting with X set to 100, but the for loop takes the X value from its own condition:
If you really want X to remain a constant, you can use it as the base of a different range, as shown ...