Skip to content

Instantly share code, notes, and snippets.

@w3ddd
Created February 21, 2012 01:00
Show Gist options
  • Save w3ddd/1872676 to your computer and use it in GitHub Desktop.
Save w3ddd/1872676 to your computer and use it in GitHub Desktop.
[ print([x,y]) for x in [1,2,3,4] for y in [5,6,7,8] ]
"""
[1, 5]
[2, 5]
[3, 5]
[4, 5]
[1, 6]
[2, 6]
[3, 6]
[4, 6]
[1, 7]
[2, 7]
[3, 7]
[4, 7]
[1, 8]
[2, 8]
[3, 8]
[4, 8]
"""
[ print([x,y]) for x in xs for y in ys if x == 1 ]
"""
[1, 5]
[1, 6]
[1, 7]
[1, 8]
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment