3 ms·
But list comprehensions make things both more succinct and more readable. Compare: "Give me one scoop of ice cream of each kind that is chocolate-flavored." .
by ptx 12y ago
But list comprehensions make things both more succinct and more readable.
Compare: "Give me one scoop of ice cream of each kind that is chocolate-flavored."
...to: "I would now like you to prepare for looking over the ice cream flavors, and also to prepare a new list which I will later fill in. Consider the first ice cream flavor. Is is chocolate? If that is the case, I would like ... once that is done, consider the next flavor ... now add this flavor to the end of the list which we prepared earlier ... consider the next flavor..."