code: def flatten(lst):
      
      def flatten_aux(item, accumulated):
          if type(item) != list:
              accumulated.append(item)
          else:
              for l in item:
                  flatten_aux(l, accumulated)
      accumulated = []
      flatten_aux(lst,accumulated)
      return accumulated
docs: flatten([["a","btr"],"b", [],["c",["d",["e"], []]]]) will return ['a', 'btr', 'b', 'c', 'd', 'e']