For Loop Dilema [python-list]

Ian Kelly ian.g.kelly at gmail.com
Mon Feb 26 10:20:33 EST 2018


On Sun, Feb 25, 2018 at 8:05 PM, INADA Naoki <songofacandy at gmail.com> wrote:
> https://docs.python.org/3.6/library/itertools.html#itertools.product

I don't see how you would use itertools.product to do what the OP
asked for. You could use itertools.chain.from_iterable, though:

py> names = ['Jack', 'Susan']
py> list(chain.from_iterable(names))
['J', 'a', 'c', 'k', 'S', 'u', 's', 'a', 'n']



More information about the Python-list mailing list