More with 'for' - where did the "animal" come from in the example?


animals = ["cat", "ant", "bat"]

for animal in animals:
print animal

where did they get that word animal? did they create that?

Replace this line with your code.


we create/define animal in the loop. Then python will assign each value from the list to the iterator (in this case animal)


Thanks- right after I posted I realized!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.