Skip to content

Instantly share code, notes, and snippets.

@joncutrer
Created January 7, 2019 20:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joncutrer/5e9da9f7542af71bcd935033d06e5377 to your computer and use it in GitHub Desktop.
Save joncutrer/5e9da9f7542af71bcd935033d06e5377 to your computer and use it in GitHub Desktop.
import itertools
x = [1, 2, 3, 4, 5, 6]
# output all permutations of x
print(list(itertools.permutations(x, 2)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment