nltk.flatten()

nltk.flatten(*args)[source]

Flatten a list.

>>> from nltk.util import flatten
>>> flatten(1, 2, ['b', 'a' , ['c', 'd']], 3)
[1, 2, 'b', 'a', 'c', 'd', 3]
Parameters:args – items and lists to be combined into a single list
Return type:list