{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "ch08-title",
   "metadata": {},
   "source": [
    "# Dictionaries and Mapping"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ch08-overview",
   "metadata": {},
   "source": [
    "Dictionaries are mapping containers for fast lookup, record-like data, counting, grouping, and key-value relationships.\n",
    "\n",
    "- Dictionaries map keys to values\n",
    "- Keys must be hashable so Python can locate values efficiently\n",
    "- Dictionary methods support lookup, mutation, iteration, and transformation\n",
    "- Comprehensions build dictionaries from existing data\n",
    "- Lookup-heavy programs often depend on dictionary design\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ch08-video",
   "metadata": {},
   "source": [
    "<h2>Video</h2>\n",
    "\n",
    "<iframe width=\"560\" height=\"315\"\n",
    "src=\"https://www.youtube-nocookie.com/embed/daefaLgNkw0\"\n",
    "  frameborder=\"0\"\n",
    "  allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\n",
    "  allowfullscreen\n",
    "  referrerpolicy=\"strict-origin-when-cross-origin\"></iframe>\n",
    "\n",
    "> *[Python Tutorial for Beginners 5: Dictionaries](https://www.youtube.com/watch?v=daefaLgNkw0) by Corey Schafer*"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ch08-goals",
   "metadata": {},
   "source": [
    "<h2>Learning Goals</h2>\n",
    "\n",
    "By the end of this chapter, you will be able to:\n",
    "\n",
    "1. Create, access, update, and delete entries in a Python dictionary\n",
    "2. Use dictionary methods such as `.get()`, `.keys()`, `.values()`, `.items()`, and `.update()`\n",
    "3. Write dictionary comprehensions and choose clear key-value structures\n",
    "4. Use dictionary patterns for counting, grouping, inversion, and sorted summaries\n",
    "5. Explain why dictionaries depend on hashable values\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ch08-flow",
   "metadata": {},
   "source": [
    "<h2>Chapter Flow</h2>\n",
    "\n",
    "```{tableofcontents}\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "dbc95da8",
   "source": [
    "<h2>Glossary</h2>\n",
    "\n",
    "| Term | Definition |\n",
    "|---|---|\n",
    "| **dictionary** | A mutable mapping that stores key-value pairs with O(1) average lookup by key |\n",
    "| **key** | The identifier used to access a value in a dictionary; must be hashable and unique |\n",
    "| **value** | The data associated with a key; can be any Python object |\n",
    "| **hash table** | The underlying data structure enabling O(1) average lookup in dictionaries |\n",
    "| **Counter** | A `dict` subclass from `collections` that counts element frequencies |\n",
    "| **defaultdict** | A `dict` subclass from `collections` that auto-creates a default value for missing keys |\n",
    "| **comprehension** | A concise one-expression syntax for building dictionaries from iterables |\n",
    "| **memoization** | Caching previously computed results in a dictionary to avoid redundant computation |"
   ],
   "metadata": {}
  },
  {
   "cell_type": "markdown",
   "id": "0800-slides",
   "metadata": {},
   "source": [
    "<h2><a href=\"overview.html\" target=\"_blank\" style=\"color: var(--pst-color-link, #176de8);\">Chapter Overview Slides</a></h2>"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
