import itertools
lst = [1, 2, 3]
permutations = []
for i in range(1, len(lst) + 1):
permutations.extend(list(itertools.permutations(lst, r = i)))
print(permutations)
'''
run:
[(1,), (2,), (3,), (1, 2), (1, 3), (2, 1), (2, 3), (3, 1), (3, 2), (1, 2, 3), (1, 3, 2), (2, 1, 3), (2, 3, 1), (3, 1, 2), (3, 2, 1)]
'''