2 ms·
This article needs some more complex examples, e.g. comprehensions with multiple "for" clauses and more complex filtering. Perhaps an example using zip or enume
by exDM69 11y ago
This article needs some more complex examples, e.g. comprehensions with multiple "for" clauses and more complex filtering. Perhaps an example using zip or enumerate.
E.g.
cartesian_product = [(a,b) for a in [1,2,3] for b in ['a','b','c']]
Could really be nice when explained in color.