Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Introducing Lists Using Lists Iteration

Albert Vathapally
Albert Vathapally
575 Points

What does it mean to iderate? Im having trouble understanding

This was gone over in the beginning of the video im having trouble understanding

2 Answers

Steven Parker
Steven Parker
229,657 Points

"Iterate" is a just a fancy word for "repeat". It's commonly used to describe the action of a loop in code, where one or more steps are done over and over several times.

It's also used in reference to whatever controls how many times the loop will repeat (often a list of items, the loop repeats once for each of them).

Daniel Turato
seal-mask
PLUS
.a{fill-rule:evenodd;}techdegree seal-36
Daniel Turato
Java Web Development Techdegree Graduate 30,124 Points

Iteration in python is where you want to run a piece of code until a certain condition is completed. There are two ways of doing this in python, for & while loops. So here's a few examples of loops:

This code below will loop each time until x is greater than 5.

x = 0

while (x < 5):
   print(x)
    x = x + 1

This code below does exactly the same as above but in a for loop

for x in range(6):
    print(x)

If you have questions you can ask me below or you can look at the documentation here - https://python101.pythonlibrary.org/chapter5_loops.html