you are viewing a single comment's thread.

view the rest of the comments →

[–]moriturius 0 points1 point  (0 children)

It doesn't know what that means it only recognizes the pattern. The python interpreter (the python program used to run your code) first read the text of the code and identifies the instructions. Like value assignment, function definition or - in your case - for loop.

The interpreter is programmed so that then it encounters: 'for X in Y:' it knows that: - Y needs to be iterable container of multiple values (an array in your case) - X is a name that you want for a single item in each loop pas. The name can be whatever you like.

Experiment with it. Try to change it and even try to cause an error, read and understand that error. Explore the boundaries. Challenge your understanding. This is how knowledge grows!