Section 1: Lists
Lesson 2: Flatten a list
Code snippet to copy:
import itertools
a = [[1, 2], [3, 4], [5, 6]]
b = list(itertools.chain.from_iterable(a))
print(b)Join @python_programming_resources for more
𝗘𝗡𝗝𝗢𝗬 𝗟𝗘𝗔𝗥𝗡𝗜𝗡𝗚👍👍
PY Python @python_programming_resources · 1.26K subscribers 
import itertools
a = [[1, 2], [3, 4], [5, 6]]
b = list(itertools.chain.from_iterable(a))
print(b)