Skip to content

Instantly share code, notes, and snippets.

@anupkalburgi
Created May 6, 2020 11:50
Show Gist options
  • Save anupkalburgi/0abe062fdd7caf1e51dcb0952748be8e to your computer and use it in GitHub Desktop.
Save anupkalburgi/0abe062fdd7caf1e51dcb0952748be8e to your computer and use it in GitHub Desktop.
explain.py
# 7. Flatten a Nested List Structure ???
- what is nested list structure
A nested structure is when we have a structure within a similar structure.
Eg: List[List[1,2,3], List[4,5,6]] is a nested structure.
Because there are lists within a list. i.e Similiar structure within it.
- what is flattening
Flattening is converting a nested structure to a not nested structure, that is collapsing a list of lists to a list
Eg: Converting List[List[1,2,3], List[4,5,6]] to List[1,2,3,4,5,6]
- how to Flatten a Nested List Structure ???
We can do that by removing the nested ness of the strucure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment