{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "ch11-title",
   "metadata": {},
   "source": [
    "# Functional Programming"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ch11-overview",
   "metadata": {},
   "source": [
    "Functional programming is a style of writing programs as transformations from inputs to outputs.\n",
    "\n",
    "- Pure functions and side effects\n",
    "- Immutable data and returned values\n",
    "- Functions as values\n",
    "- Comprehensions, lambdas, and higher-order functions\n",
    "- Decorators, recursion, context managers, and `functools`\n",
    "\n",
    "Python is not a purely functional language, but it includes functional tools that help you write concise, reusable, and testable code.\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1100-video",
   "metadata": {},
   "source": [
    "<h2>Video</h2>\n",
    "\n",
    "This overview introduces the idea that functions are values that can be assigned, passed, and returned.\n",
    "\n",
    "```{raw} html\n",
    "<iframe width=\"100%\" height=\"400\" src=\"https://www.youtube-nocookie.com/embed/kr0mpwqttM0\" title=\"Python Tutorial: First-Class Functions\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen referrerpolicy=\"strict-origin-when-cross-origin\"></iframe>\n",
    "```\n",
    "\n",
    "> *[Python Tutorial: First-Class Functions](https://youtube.com/watch?v=kr0mpwqttM0) by Corey Schafer*"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ch11-goals",
   "metadata": {},
   "source": [
    "<h2>Learning Goals</h2>\n",
    "\n",
    "By the end of this chapter, you will be able to:\n",
    "\n",
    "1. Identify pure functions and avoid unnecessary side effects\n",
    "2. Use immutability by returning new values instead of mutating existing objects\n",
    "3. Treat functions as first-class values that can be passed to and returned from other functions\n",
    "4. Use lambda functions with `map()`, `filter()`, and `sorted()`\n",
    "5. Build decorators, recursive functions, context managers, and selected `functools` utilities\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ch11-flow",
   "metadata": {},
   "source": [
    "<h2>Chapter Flow</h2>\n",
    "\n",
    "```{tableofcontents}\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1100-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
}
