Exam GPYC All QuestionsBrowse all questions from this exam
Question 1

Which of the following will be the value of the variable y?

    Correct Answer: C

    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.

Discussion
VenudharOption: C

Answer is 6