A nested list is a list that appears as an element in another list. Nested lists in Python are lists that contain other lists as their elements. They are useful for representing structured data like tables, grids, and trees.
When you have a nested list, each list within the main list can be accessed using an index. To access elements within those nested lists, you chain multiple indices together.
In this list, the element with index 3 is a nested list. If we print(nested[3]), we get [10, 20]. To extract an element from the nested list, we can proceed in two steps. First, extract the nested list, then extract the item of interest.