Created
February 6, 2014 15:39
-
-
Save Duta/8846589 to your computer and use it in GitHub Desktop.
Printing all permutations of {1, 2, 3, 4} in python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use this version if you have Python 2.7 | |
from itertools import permutations | |
for perm in permutations([1,2,3,4]): | |
print perm | |
raw_input() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use this version if you have Python 3.3 | |
from itertools import permutations | |
for perm in permutations([1,2,3,4]): | |
print(perm) | |
input() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment