Computer Science

Predict the output

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

Python Dictionaries

5 Likes

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

Answered By

3 Likes


Related Questions