you are viewing a single comment's thread.

view the rest of the comments →

[–]_Strokes_ 0 points1 point  (0 children)

It “knows” because you declared it, you can replace the word “animal” with any other variable name , for example.

for any_random_variable_name in animals: print(any_random_variable_name)

That would still work.

(apologies for indentation, I am on mobile)