this post was submitted on 22 Nov 2023
295 points (100.0% liked)
196
16597 readers
2653 users here now
Be sure to follow the rule before you head out.
Rule: You must post before you leave.
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
What would be the alternative? (assuming that you want to do the loop yourself)
or else
which doesn't do the exact same thing.
Honestly, this list comprehension is much faster to read and quite easy to understand.
I think we could rename the "result" variable "x" or "res" and it would be less confusing though.