Sail E0 Webinar
Question
What is the output of the following code?a={}a[2]=1a[1]=[2,3,4]print(a[1][1])
Options:
A .  [2,3,4].
B .  3
C .  2
D .  An exception is thrown
Answer: Option B


Now, a={1:[2,3,4],2:1} . a[1][1] refers to second element having key 1.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers