[f(x, y) for x in X for y in Y] is equivalent to: [f(x, y) for x, y in cartesian(X, Y)] I never found any real use for list comprehensions with more than one dimension. When I use nested loops they are usually for something that cannot be expressed as a list comprehension. Oren
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4