title: permutation function does not return answers as a list
body: <p>I am trying to get all possible permutations for characters in a list. I need it to return all possible perms inside a list. A list of lists, where each component of the list is a permutation. Cant seem to figure out whats wrong with it. Tried playing around with the lists but nothing helps. Trying to get this done without importing anything.</p>
  
  <p>the code:</p>
  
  <pre><code>def permutation(lst1, num_of_perms):
      if num_of_perms == len(lst1) - 1:
          print(lst1)
  
      for i in range(num_of_perms, len(lst1)):
          #  "removes" the first component of the list and returns all
          #  permutations where it is the first letter
          lst1[i], lst1[num_of_perms] = lst1[num_of_perms], lst1[i]
          #  swaps two components of the list each time.
          permutation(lst1, num_of_perms + 1)
          lst1[i], lst1[num_of_perms] = lst1[num_of_perms], lst1[i]
          #  swaps back before the next loop
  </code></pre>
  
  <p>Also i am open for any tips on how to improve the coding style.</p>