title: Python Itertools Permutations
body: <p>I am currently writing a program that uses itertools, and one piece of it does not seems to functioning properly. I would like the input that determines the length of the lists the permutation function outputs to be equal to length of the list from which it generates its outputs. In other words, I have</p>
  
  <pre><code>import itertools
  
  b = 0
  c = 9
  d = [0,1,2]
  e = len(d)
  
  
  while b &lt; c:
          d.append(b)
          b = b+1
  
  print([x for x in itertools.permutations(d,e)])
  </code></pre>
  
  <p>And I would like this to generate all the possible permutations of d that are equal to this length. I have been experimenting with this and it seems that second determiner must be an integer. I even tried making a new variable, f, and having <code>f = int(e)</code> and then replacing e with f in the print statement, but with no success. With either of these all I got was <code>[()]</code></p>
  
  <p>Thanks for your help. </p>