Ref: python decompose a list Flattening a shallow list in Python
While the above mentioned solutions are helpful, my problem is slightly different, and I was wondering if there is a pythonic way to solve it.
a = [['a-3','b-3'],'r',['j']]
What I would like, is a clean way of making 'a' equal the following:
a = ['a-3','b-3','r','j']
I am stuck using python 2.4 so a pythonic solution that's 2.4 compatible would be great, but I would still find 2.7+ examples interesting as well.
The main problem is that there are non-iterable elements, otherwise the sum(lst,[]) works quite well, as does the chain method for 2.7+