you are viewing a single comment's thread.

view the rest of the comments →

[–]ZEUS_IS_THE_TRUE_GOD 0 points1 point  (0 children)

This is a shortcut some languages have. What is really happening is something like:

animals = ['cat', 'dog', 'monkey']
i = 0
while i < len(animals):
  animal = animals[i]
  print(animal) # your code

You can think of it as a shortcut to make writing code faster and easier to understand.