You are viewing a single comment's thread. Return to all comments →
You need to read the Python documentation on comprehensions or a tutorial on them.
When you type something like
[2 * x for x in numbersList]
The "for x" is defining the variable x. This is also what "for" does in for loops - why does that not confuse you but this does?
Seems like cookies are disabled on this browser, please enable them to open this website
Nested Lists
You are viewing a single comment's thread. Return to all comments →
You need to read the Python documentation on comprehensions or a tutorial on them.
When you type something like
The "for x" is defining the variable x. This is also what "for" does in for loops - why does that not confuse you but this does?