permutations
-
[Python] - Permutation & Combination개발/Python 2022. 7. 27. 19:50
Permutation process of changing the linear order of an ordered set support itertools Permutations differ from combinations , which are selections of some members of a set regardless of order set {1, 2, 3} -> (1, 2, 3), (1, 3, 2), (2, 1, 3), (2, 3, 1), (3, 1, 2), (3, 2, 1) Syntax permutations(iterable, r=None) from itertools import permutations list( permutations('ABC', 2) ) > [('A', 'B'), ('A', ..