How to merge multiple lists into one list in python?

user1452759 picture user1452759 · Jul 20, 2012 · Viewed 306.7k times · Source

Possible Duplicate:
Making a flat list out of list of lists in Python
Join a list of lists together into one list in Python

I have many lists which looks like

['it']
['was']
['annoying']

I want the above to look like

['it', 'was', 'annoying']

How do I achieve that?

Answer

BrenBarn picture BrenBarn · Jul 20, 2012

Just add them:

['it'] + ['was'] + ['annoying']

You should read the Python tutorial to learn basic info like this.