Skip to content

Instantly share code, notes, and snippets.

@timofurrer
Created March 19, 2012 19:18
Show Gist options
  • Save timofurrer/2124946 to your computer and use it in GitHub Desktop.
Save timofurrer/2124946 to your computer and use it in GitHub Desktop.
Python permutations of a list
#!/usr/bin/python3.2
import itertools
print( list( itertools.permutations( [1, 2, 3, 4], 2) ) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment