title: How can I solve this problem using itertools?
body: <p>Hello I have tried using this tool:</p>
  
  <pre><code>list(combinations('01', 3))
  </code></pre>
  
  <p>but I get this result:</p>
  
  <pre><code>[]
  </code></pre>
  
  <p>I would like to have these results:</p>
  
  <pre><code>000
  001
  011
  111
  101
  100
  010
  </code></pre>
  
  <p>Separately, I would also like to have different cases.</p>
  
  <p>for instance, given <code>111</code> I expect these results: </p>
  
  <pre><code>111
  12
  21
  3
  </code></pre>
  
  <p>Is it possible to do these two things using <code>itertools</code>? </p>