Dear fellow colleagues,
What does i for i mean,which is used in the range
Dear fellow colleagues,
What does i for i mean,which is used in the range
for i in range
, this i
is the iterator. Just like a normal for loop. Nothing new there?
[i for
is what you are appending to the list, if you did: [i**2 for
, you would append the exponent.
you could challenge yourself and try to see if you can write the same code without list comprehension.
This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.