title: Getting all recursion results in a list
body: <p>I'm learning about python recursion. To practice i'm giving a task to find all subset of a list. For example the function:</p>
  
  <pre><code>subset([1,2)] should return [[1,2],[1],[2],[]]
  </code></pre>
  
  <p>I can get my function print these results with the help of recursion</p>
  
  <pre><code>def subset(List):
     print(List)
     n = len(List)
     if n &gt; 2:
        for i in range(n):
           subset(List[:i]+List[i+1:])
  
     if n == 2:
        subset([List[0]])
        subset([List[1]])
     if n == 1:
        subset([])
  pass
  
  L = [1,2]
  test = subset(L)
  </code></pre>
  
  <p>The print statement prints:</p>
  
  <pre><code>[1, 2], [1], [], [2], []
  </code></pre>
  
  <p>I would love to have the function to not print but instead return this in a list as given by the desired result.</p>
  
  <p>I Would love your take on this.</p>