title: Flatten an arbitrarily nested list with recursion
body: <p>I have a question about recursion.</p>
  
  <pre><code>def f6(lst):
  result = []
  if type(lst[0]) == list:
      return f6(lst[0])
  else:
      result.append(lst[0])
  
      if lst[1]:
          return f6(lst[1])
  
      else:
          return result
  </code></pre>
  
  <p>I want to make one dimensional list from multidimensional list input.
  For example, when I put <code>["baa",[4,True,[10, 5],[1,2,['moo']]],['chirp']]</code>
  ,I want to take <code>["baa",4,True,10, 5,1,2,'moo','chirp']</code></p>
  
  <p>But it gives me <code>index out of range</code> error at <code>if lst[1]:</code></p>
  
  <p>Can't I use <code>lst[1]</code> as True/False condition?
  I appreciate your help.</p>