generate all permutations of an array python code example
Example 1: all permutations python
import itertools
print(list(itertools.permutations([1,2,3])))
Example 2: how to get all possible combinations in python
all_combinations = [list(zip(each_permutation, list2)) for each_permutation in itertools.permutations(list1, len(list2))]