Membership

In operator

The membership operator in checks if the key is present in the dictionary and returns True, else it returns False.

Example:

Dictionary - In operator - Example - Teachoo.png

Not in operator

The not in operator returns True if the key is not present in the dictionary , else it returns False.

Example:

Dictionary - Not in operator - Example - Teachoo.png

Go Ad-free
Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh has done his B.Tech from Indian Institute of Technology, Kanpur. He has been teaching from the past 14 years. He provides courses for Maths, Science, Social Science, Physics, Chemistry, Computer Science at Teachoo.