Created
October 20, 2014 01:21
-
-
Save r2k0/ad18d9a8dcbd7420133e to your computer and use it in GitHub Desktop.
Revisions
-
r2k0 created this gist
Oct 20, 2014 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ >>> from itertools import permutations >>> perms = [''.join(p) for p in permutations('hat')] >>> perms ['hat', 'hta', 'aht', 'ath', 'tha', 'tah'] >>> print sorted(perms) ['aht', 'ath', 'hat', 'hta', 'tah', 'tha'] >>> print ','.join(sorted(perms)) aht,ath,hat,hta,tah,tha