Consider the List l1 = ['SIPO', [1, 3, 5, 7]. What will be the output of following print statement. print(l1[0][1], l1[1][1])
Answers
Answered by
1
Answer:
The output is
sipo, [1,3,5,7]
[1,3,5,7]
Answered by
3
Program :
l1 = ['SIPO' , [1 , 3 , 5 , 7]]
print(l1[0][1] , l1[1][1])
Output :
I 3
Explanation :
Indexing of l1 : ['SIPO' , [1 , 3 , 5 , 7]]
0 1
Indexing of 'SIPO' : S I P O
0 1 2 3
Indexing of [1 , 3 , 5 , 7] : [1 , 3 , 5 , 7]
0 1 2 3
l1[0][1] : l1[0] means 'SIPO' and l1[0][1] means I
So, l1[0][1] = I
l1[1][1] : l1[1] means [1 , 3 , 5 , 7] and l1[1][1] means 3
So, l1[1][1] = 3
Therefore, output is I 3
Similar questions