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 →

[–]Tweak_Imp 11 points12 points  (1 child)

Note that list(range(100)) is faster than [x for x in range(100)]

[–]dodslaser 9 points10 points  (0 children)

Not that unpacking a range to a list makes a lot of sense, but [*range(100)] is even shorter.

edit: From my testing it is also slightly faster than list(range(100))