You can use the bellow-mentioned code to generate the permutations of list in Python:-
def permutations(head, tail=''):
if len(head) == 0: print tail
else:
for i in range(len(head)):
permutations(head[0:i] + head[i+1:], tail+head[i])
The caller code is as follows:-
permutations('abc')
To know more about this you can have a look at the following video tutorial:-