Nested List
• A list can have heterogeneous elements like int , oat etc.
• A list can have a list as an element inside it this is called nested list for example
Ex : list = [10, 20 [ ‘ a ’, ‘ b ’ [ ‘ c ’, ‘ d ’] , 30 , 40 ] ]
• Diagrammatically it can be represented as
• If you are having nested list you can prepare a matrix also with same type of values . Lets, see
this in a program
# A, B are 2 list in which nested list resides
On this 2 list we are performing addition and
appending the results in C and printing the
result
• Just like + you can also perform - , * on a matrix
fl