Explain Nested lists.
Answers
Answered by
2
A nested list is simply a list that occurs as an element of another list(which may of course itself be an element of another list, etc.). Common reasons nested lists arise are: They're matrices (a list of rows, where each row is itself a list, or a list of columns where each column is itself alist)
Answered by
0
Answer:
A nested list is a list within another list. Elements of a nested list can be accessed by integer indexing.
Eg:
list1 = [1, 2, 3, [4, 5], 6]
print(list1[3])
o/p
[4,5]
Similar questions