<jupyter_start><jupyter_text>**Python Dictionaries**  **1. Dictionary**- A **dictionary** is a collection which is unordered, changeable and indexed. - In Python, dictionaries are written with curly brackets, and they have keys and values, called **Key-Value Pairs**.<jupyter_code>#Example - Create and print a dictionary:

thisdict = {
  "brand": "Ford",
  "model": "Mustang",
  "year": 1964
}
print(thisdict)<jupyter_output>{'brand': 'Ford', 'model': 'Mustang', 'year': 1964}<jupyter_text>**2. Accessing Items**- You can access the items or values of a dictionary by referring to its key name, inside square brackets.<jupyter_code>#Example - Get the value of the "brand" key.

x = thisdict["brand"]

x
#Example - Get the value of the "model" key.

y = thisdict["model"]

y
#Example - Get the value of the "year" key.

z = thisdict["year"]

z<jupyter_output><empty_output><jupyter_text>2.1 **get() method**- There is also a method called **get()** that will give you the same result.<jupyter_code>#Example - Get the value of the "brand" key.

x1 = thisdict.get("brand")

x1<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13949275362318841, 'fraction_numerical': 0.012681159420289856, 'mean_word_length': 5.138888888888889, 'pattern_counts': {'":': 3, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 0, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '390013', 'license': 'CC0-1.0', 'n_tokens_mistral': 388, 'n_tokens_neox': 366, 'n_words': 129, 'path': 'Python_Dictionaries.ipynb', 'repo_name': 'pb111/Python', 'size': '1104'}