title: Python Using Recursion to Traverse Through a Nested List With Conditions
body: <p>Suppose I have the following:</p>
  
  <pre><code>def foo(lst):
    current = 0
    if(len(lst) == 0):
      return current
    first = bar(lst[0])
    rest = foo(lst[1:])
    if(first &gt; current):
      current = first
    return current
  
  if __name__ == "__main__":
    lst1 = [2,4,6]
    lst2 = [0,2,5,6,12]
    lst3 = []
    lst4 = [1]
    lst5 = [2]
    full_lst = [lst1, lst2, lst3, lst4, lst5]
    print(foo(full_lst))
  </code></pre>
  
  <p>This function takes a nested list in the above structure as a parameter. The goal of the function is to traverse through this nested list structure recursively and apply a computation to each list. The function is also to keep track of each computation and eventually return the largest of these values obtained from the computations.</p>
  
  <p>I believe I have some the basic structure complete, but I fail to see how I could use the function call on the smaller sub list and compare the value obtained from that with the one obtained from the previous function call.</p>
  
  <p>Thanks.</p>