CBSE Class 11 Informatics Practices
Question 48 of 66
Dictionary — Question 20
Back to all questionsWe cannot directly check for a value inside a dictionary using in operator since in operator searches for a key in a dictionary. We can use values() function along with in operator to check for a value in dictionary as shown below:
>>> d = {1: 'a' , 2:'b'}
>>> 'b' in d.values()
Output
True