# importing required ibrary import itertools # declaring a list lst = [2,2,2] # creating a list of pairs of the list ordered_list = itertools.permutations(lst,2) print(list(ordered_list))