CBSE Class 11 Computer Science Question 96 of 112

Dictionaries — Question 18

Back to all questions
18
Question

Question 13(a)

Predict the output

a = {(1,2):1,(2,3):2}	
print(a[1,2])
Answer
Output
1
Explanation

a is a dictionary containing two key-value pair.
(1,2) is a key of a. Therefore, a[1,2] represents value of key 1,2 i.e.,1