Skip to content

Check if a key exists in a dictionary

dictionary = {'class': 'X', 'age': 16, 'score': 88, 'name': 'Anand', 'sex': 'Male'}

print ('name' in dictionary)


print ('address' in dictionary)

See also  Java code snippet - How to change the icon of a jframe?

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.