if 'key1' in my_dict:
print("blah")
else:
print("boo")
my_dict = {1: 'a', 2: 'b', 3: 'c'}
if 2 in my_dict:
print("present")
d = {'a': 1, 'b': 2}
'a' in d # <== evaluates to True
'c' in d # <== evaluates to False
if 'key1' in my_dict:
...
message = "blah" if 'key1' in my_dict else "booh"
print(message)