title: How do I transform this lambda function into def format?
body: <p>I found this answer to a question here (<a href="https://stackoverflow.com/questions/50200297/how-to-build-a-recursion-for-arbitrary-lists">How to build a recursion for arbitrary lists?</a>) but I haven't learnt how to use <strong>lambdas</strong>.</p>
  
  <pre><code>prune = lambda tree : [prune(branch) for branch in tree if branch != []]
  
  l = [[[[], []], [[], []]], [[], [], []]]
  print prune(l)
  </code></pre>
  
  <p>I checked many websites but I can not seem to manage to transform this into a regular function like:</p>
  
  <pre><code>def prune(tree):
      for branch in tree:
          if branch!=[]:
               prune(branch)
      return branch
  
  print prune([[[[], []], [[], []]], [[], [], []]])
  </code></pre>
  
  <p>Can someone tell me what are those big square brackets for before prune and at the end?</p>