Q:

How can you create a list of lists while swapping numbers

Let's say I have a list of numbers 
L1 = [1,2,3]

I want to be able to generate many lists from this list while swapping the numbers.
L1 = [1,2,3] 
L2 = [2,1,3]
L3 = [3,2,1]
L4 = [1,3,2]

What is the best way to do this?

A:

from itertools import permutations

print(list(permutations(L1)))

While give you a list of what you want

