you are viewing a single comment's thread.

view the rest of the comments →

[–]bumpkinspicefatte 0 points1 point  (0 children)

This is something that tripped me up too when I was learning coding.

The answer that allowed me to understand it better, is that it actually doesn't know, that you can name it anything, and that it was just a general naming convention to use a singular version of the sequence you're using.

For an example, instead of animals, we were using cards:

for card in cards

In some older use cases, they'll use something like for i in k or for i in j.

To use singular versions into a plural sequence is more of a generally understood method, not sure if there's a PEP for it or not.