Which of the following will be the value of the variable y?
Which of the following will be the value of the variable y?
The dictionary 'x' has two keys: 'a' and 'b'. The key 'b' is associated with the value which is a list: [[5, 6], 7]. Accessing x['b'][0] retrieves the first element of the list associated with 'b', which is [5, 6]. Then, accessing [5, 6][1] retrieves the second element of that list, which is 6. Therefore, the value of the variable y is 6.
Answer is 6