title: recursive way to go through a nested list and remove all of a select value
body: <p>I'm trying to remove all empty lists from a nested list recursively. </p>
  
  <pre><code>def listcleaner(lst):
     if isinstance(lst[0], int):
        return listcleaner(lst[1:])
  
  
     if isinstance(lst[0], list):
       if len(lst[0]) == []:
          lst[0].remove([])
          return listcleaner(lst)
       return listcleaner(lst[0])
     return lst
  </code></pre>
  
  <p>and what I'd like the function to do is</p>
  
  <pre><code>&gt;&gt;&gt; a = listcleaner([1, [], [2, []], 5])
  &gt;&gt;&gt; print(a)
  [1, [2], 5]
  </code></pre>