def check_key_in_dict(dictionary, key):
# Using the 'in' keyword to check if the key exists in the dictionary
if key in dictionary:
return True
else:
return False
def main():
# Example dictionary
my_dict = {'a': 1, 'b': 2, 'c': 3}
# Key to check
key_to_check = 'b'
# Check if key exists in the dictionary
if check_key_in_dict(my_dict, key_to_check):
print(f"The key '{key_to_check}' exists in the dictionary.")
else:
print(f"The key '{key_to_check}' does not exist in the dictionary.")
if __name__ == "__main__":
main()