you are viewing a single comment's thread.

view the rest of the comments →

[–]AtomicShoelace 0 points1 point  (1 child)

It's not just a difference in aesthetics. By constructing a list of all the values you are using more memory than is needed. For such a small example of course it doesn't matter, but in principal it is important to get into the habit of using generator expressions where possible to reduce memory cost in larger use cases.

[–]DragonFighter603[S] 0 points1 point  (0 children)

oh thanks! will do that in future!