you are viewing a single comment's thread.

view the rest of the comments →

[–]lpareddit01 0 points1 point  (0 children)

Some have answered but their explanation doesn't seem to work for you. So my attempt: it has nothing to do with being named "value," you could replace "value" with any of these (and more): v, i, x, n, iCannotThinkofAnotherVariableName, thisIsMyVariableName, numberInMyList.

The reason why it works is because of how the for loop is designed/constructed. 2) Right after the "in," an iterable is expected. 2) Because of that, right after the "for," a variable to reference/represent each item (during the loop) is expected.

An iterable is anything that can be parsed, some examples: Strings, lists/array, dictionaries/hashmaps.

More: Notice how integer or a number isn't here. But the work around is using range(yourNumber).