How to merge multiple lists into one list in python? [duplicate] How to merge multiple lists into one list in python? [duplicate] python python

How to merge multiple lists into one list in python? [duplicate]


import itertoolsab = itertools.chain(['it'], ['was'], ['annoying'])list(ab)

Just another method....


Just add them:

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

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


a = ['it']b = ['was']c = ['annoying']a.extend(b)a.extend(c)# a now equals ['it', 'was', 'annoying']