title: Python Subset Sum
body: <p>I am trying to write a function that will not only determine whether the sum of a subset of a set adds to a desired target number, but also to print the subset that is the solution. </p>
  
  <p>Here is my code for finding whether a subset exists:</p>
  
  <pre><code>def subsetsum(array,num):
  
      if num == 0 or num &lt; 1:
          return False
      elif len(array) == 0:
          return False
      else:
          if array[0] == num:
              return True
          else:
              return subsetsum(array[1:],(num - array[0])) or subsetsum(array[1:],num)
  </code></pre>
  
  <p>How can I modify this to record the subset itself so that I can print it? Thanks in advance!</p>