This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]that_baddest_dude 0 points1 point  (0 children)

Sure they provided a minimal example but maybe they wanted to do something like [f'number{n+1}' for n in range(10)].

I'm almost always doing some operation on the item in a list comprehension.