python flatten list with some function in to single value code example Example: python flatten list itertools.chain.from_iterable(factors)