Answers for "flatten a list of list itertools"

0

flatten a list of list itertools

import itertools

regular_list = [[1, 2, 3, 4], [5, 6, 7], [8, 9, 10]]
flat_list = list(itertools.chain(*regular_list))

print('Original list', regular_list)
print('Transformed list', flat_list)
Posted by: Guest on March-03-2021

Code answers related to "flatten a list of list itertools"

Browse Popular Code Answers by Language