What is the output of print(1 in {'a': 1}) in Python?
print(1 in {'a': 1})
Correct answer
C. False
C. False
in checks keys, not values.
Asked in: Python Interview Dictionaries
https://docs.python.org/3/tutorial/datastructures.html#dictionariesNot sure why the answer is C? Ask here and get an explanation.