find all permutations of numbers ython code example
Example 1: all permutations python
import itertools
print(list(itertools.permutations([1,2,3])))
Example 2: find all permutations of a string
ABC
ACB
BAC
BCA
CBA
CAB
import itertools
print(list(itertools.permutations([1,2,3])))
ABC
ACB
BAC
BCA
CBA
CAB