Unstring Python?

python

Solution

You want to produce a string, so you can use string manipulation (in particular, the `join` method):

>>> import itertools
>>> a = ['A', 'B']
>>> b = ['D', 'E', 'F']
>>> print ', '.join(''.join(x) for x in itertools.product(a, b))
AD, AE, AF, BD, BE, BF

Actually you don't even need `itertools`, you could just use a nested comprehension:

>>> print ', '.join(x + y for x in a for y in b)

Problem

I am a noob, How do I remove quotations and commas from my list? Or how do I "unstring"? Without showing the dictionary (dic), the code I am using looks like this: ``` >>>import itertools >>>list(itertools.product(dic[2], dic[3]) ``` my results looks like this: ``` [('A', 'D'), ('A', 'E'), ('A', 'F'), ('B', 'D'), ('B', 'E'), ('B', 'F'), ('C', 'D'), ('C', 'E'), ('C', 'F')] ``` I would like them to look like this: ``` AD, AE, AF, BD, BE, BF, ```

Original source