Skip to content

Instantly share code, notes, and snippets.

Created Jul 10, 2020
What would you like to do?
print (d)#Output:{'red': 1, 'blue': 2, 'green': 3}
#Checking whether the particular key is in dictionary or not.
if 'red' in d:
print ("True")#Output:True
if 'yellow' in d:
print ("True")
print ("False") #Output:False
if "yellow" not in d:
print ("True")#Output:True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment