Source Code:
(back to article)
my_dict = {'a': 1, 'b': 2, 'c': 3} if 'a' in my_dict: print("Key 'a' exists in dictionary") else: print("Key 'a' does not exist in dictionary")
Result:
Report an issue