Iteration is the idea of repeating something whether it be infinitely or for a set amount of times. We see iteration in our everyday lives. For instance, we walk to our school taking, let’s say, 1000 steps.
Iteration is one of three logical structures in programming that allows you to control the flow of the program. As such, you can have a task be performed X amount of times by simply putting it in iteration (we will talk about how later) instead of manually putting code for each time.
Loop is often another term used for iteration. This picture perfectly presents all the parts of a loop. We have a condition in which we will be followed to repeat the code inside the loop. Update counter means updating the condition (like if the condition is “do 10 times”, the counter will increase the current time by one).
Next SectionIteration Types
Copyright © 2021 Code 4 Tomorrow. All rights reserved. If you would like to use content from any of our courses, you must obtain our explicit written permission and provide credit. Please contact email@example.com for inquiries.