- Nested list is a concept of creating a list inside another list.
- List contain list is called nested list.
- Yes it is possible to create a nested list in python, as we know list is collection of different data types like int,string so we can also add list type type in the collection.
Example
[1,2,3,4] // it is a simple list.
[1,[1,2,3],2,3,4] // it is a nested list.
program-
l=[1,["one","two","three"],3,4]
#one dimensional
print(l[0])
print(l[1])
print(l[2])
print(l[3])
#two dimensional
print(l[1][0])
print(l[1][1])
print(l[1][2])
1
['one', 'two', 'three']
3
4
one
two
three