Python #Shorts Flatten a list with Itertools chain() function

preview_player
Показать описание
#Shorts

Using the itertools chain function to flatten a nested list
Рекомендации по теме
Комментарии
Автор

Hi! I Couldn't see the code, the Very Academy logo was over the code.

stifferdoroskevich
Автор

For some reason it does nothing, output of chain() is the same array as nl. Python 3.8.6x64 win10. If you pass the iterables without the brackets " list(itertools.chain([1], [2, 3], [4, 5]))" it does work.

nopens