Sort a list in all possible ways in Python : <p>Let's suppose we make this list</p>

<pre><code>a=[1,2,3]
</code></pre>

<p>a can be sorted in 6 possible ways</p>

<pre><code>a=[1,2,3]
a=[1,3,2]
a=[2,1,3]
a=[2,3,1]
a=[3,1,2]
a=[3,2,1]
</code></pre>

<p>How do I make a function that automatically does that but with bigger lists?</p>
