Lists in python are a very powerful data type used in a broader spectrum of programing. If a list containing another list, in turn may contain another list then it is known as Nested list. Here are a few examples for better understanding:-
list1 = [“c“, “o“, “d“, “e“]
list2 = [“w“, “e“, [“c“, “o“, “d“, “e“, “r“]]
list3 = [“w“, “e“, [“c“, “o“, [“d“, “e“]]]
Here,
list1 contain elements but no list within the parent list.
list2 contain a list within the parent list.
list3 contains a list which in turn contains another list.