1# A Python program to print all permutations using library function
2from itertools import permutations
3perm = permutations([1, 2, 3])
4for i in list(perm):
5 print (i)
6# (1, 2, 3)
7# (1, 3, 2)
8# (2, 1, 3)
9# (2, 3, 1)
10# (3, 1, 2)
11# (3, 2, 1)