How to search through dictionaries?

If you want to know if key is a key in people, you can simply use the expression key in people, as in:

if key in people:

And to test if it is not a key in people:

if key not in people:

Leave a Comment