Finding combination of elements of a list
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/464864/python-code-to-pick-out-all-possible-combinations-from-a-list">Python code to pick out all possible combinations from a list?</a>  </p>
</blockquote>



<p>I have a list say [1, 2, 3]. I want to find the all the combinations</p>

<pre><code>C(3,1)
[1] [2] [3]

C(3,2)
[1,2] [2,3] [1,3]

C(3,3)
[1,2,3]
</code></pre>

<p>Is there some module/library for doing this?</p>
