{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "18c084e6",
   "metadata": {},
   "source": [
    "# Exceptions & Testing"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b4e11eb2",
   "metadata": {},
   "source": [
    "Errors are inevitable in any program. Python distinguishes two major categories: **exceptions** (runtime errors that interrupt execution) and **semantic errors** (silent bugs where code runs but produces the wrong answer). This chapter teaches you to handle both: \n",
    "- exception handling lets your program recover gracefully from runtime failures; \n",
    "- debugging and testing techniques help you find and eliminate logic errors before they reach users.\n",
    "\n",
    "**Learning goals:** By the end of this chapter you will be able to:\n",
    "\n",
    "- Distinguish between syntax errors, runtime errors, and semantic errors\n",
    "- Read and interpret Python tracebacks to locate the source of a bug\n",
    "- Handle exceptions gracefully with `try`, `except`, `else`, and `finally`\n",
    "- Catch specific exception types and provide a meaningful response to each\n",
    "- Raise exceptions with `raise` and define custom exception classes\n",
    "- Apply print-statement debugging and `assert` to isolate bugs systematically\n",
    "- Write `doctest` examples, `unittest` test cases, and `pytest` functions to verify function behavior\n",
    "- Explain the difference between type hints, static type checking, runtime validation, and tests\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "865285c5",
   "metadata": {},
   "source": [
    "<h2>Chapter flow</h2>\n",
    "\n",
    "```{tableofcontents}\n",
    "```"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
