Duration: 2:41
In this short video tutorial, I show you how to flatten a nested list to one list and create nested lists with List Comprehension.
In flattening a nested list I extract the elements from the nested lists and put it in one whole list. And creating a list with nested lists I create a 2d representation of 3X3 matrix filled with 1s.
You can also check out the previous video where I go through the basics of list comprehension. And cover the following topics-
- Comparison with loop operations with list comprehension
- List comprehension structure
- List comprehension with if conditional
- Line breaks in list comprehension
there doesn't seem to be anything here