<jupyter_start><jupyter_text>All the IPython Notebooks in this **Python Examples** series by Dr. <NAME> are available @ **[GitHub](https://github.com/milaan9/90_Python_Examples)**  Python Program to Check if a Key is Already Present in a DictionaryIn this example, you will learn to check if a key is present in a dictionary.To understand this example, you should have the knowledge of the following **[Python programming](https://github.com/milaan9/01_Python_Introduction/blob/main/000_Intro_to_Python.ipynb)** topics:* **[Python List](https://github.com/milaan9/02_Python_Datatypes/blob/main/005_Python_Dictionary.ipynb)**<jupyter_code># Example 1: Using in keyword

my_dict = {1: 'a', 2: 'b', 3: 'c'}

if 2 in my_dict:
    print("present")

'''
>>Output/Runtime Test Cases:
     
present
'''<jupyter_output>present
{'fraction_non_alphanumeric': 0.12484700122399021, 'fraction_numerical': 0.02447980416156671, 'mean_word_length': 5.596774193548387, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '420583', 'license': 'MIT', 'n_tokens_mistral': 287, 'n_tokens_neox': 260, 'n_words': 81, 'path': '02_Python_Datatypes_examples/016_check_if_a_key_is_already_present_in_a_dictionary.ipynb', 'repo_name': 'peterennis/90_Python_Examples', 'size': '824'}