2015-03-08から1日間の記事一覧
(python2.7) $ ipython In [1]: from itertools import combinations, permutations In [2]: arr = ['a', 'b', 'c', 'd'] In [3]: list(permutations(arr)) Out[3]: [('a', 'b', 'c', 'd'), ('a', 'b', 'd', 'c'), ('a', 'c', 'b', 'd'), ('a', 'c', 'd', 'b…