title: python: flatten list of lists OF LISTS
body: <p>I know this has been asked before but I don't see any solutions for when there is a list of the type:</p>
  
  <p>original_list = [[1,2], [3], [4,5,[6]]]</p>
  
  <p>Tried this method:</p>
  
  <pre><code>def flatten(list):
  
      """Given a list that contains elements and other lists, this
         will return a new list that has no sublists ("flattened")"""
  
      flat = [] # new empty list to populate with flattened list
  
      for sublist in list: # iterate through list elements
          for element in sublist: #
              flat.append(element)
  
      return flat
  
  print(flatten([1,2,3]))
  </code></pre>
  
  <p>This method too:</p>
  
  <pre><code>old_list = [[1,2], [3], [4,5,[6]]]
  
  flat1 = []
  
  flat1 = [sum(old_list, [])] # 1 layer deep
  
  flat2 = []
  
  flat2 = [sum(flat1), []] # 2 layers deep
  
  print(sort2)
  </code></pre>
  
  <p>Not having any luck... tips? Thanks!</p>