I have a list
of strings
which contains a sublist
os strings
:
ids = [u'spotify:track:3ftnDaaL02tMeOZBunIwls', u'spotify:track:4CKjTXDDWIrS0cwSA9scgk', [u'spotify:track:6oRbm1KOqskLTFc1rvGi5F',
u'spotify:track:045sp2JToyTaaKyXkGejPy']]
I tried to flatten it with:
[item for item in ids for item in sublist]
and
chain = itertools.chain(ids)
but these solutions split the strings...
how do I flatten the original list
into
[u'spotify:track:3ftnDaaL02tMeOZBunIwls', u'spotify:track:4CKjTXDDWIrS0cwSA9scgk', u'spotify:track:6oRbm1KOqskLTFc1rvGi5F',u'spotify:track:045sp2JToyTaaKyXkGejPy']
?