{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "9d97603b",
   "metadata": {},
   "source": [
    "# Strings "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "03de58b0",
   "metadata": {
    "tags": [
     "hide-input"
    ]
   },
   "outputs": [],
   "source": [
    "import sys\n",
    "from pathlib import Path\n",
    "\n",
    "current = Path.cwd()\n",
    "for parent in [current, *current.parents]:\n",
    "    if (parent / '_config.yml').exists():\n",
    "        project_root = parent  # ← Add project root, not chapters\n",
    "        break\n",
    "else:\n",
    "    project_root = Path.cwd().parent.parent\n",
    "\n",
    "sys.path.insert(0, str(project_root))\n",
    "\n",
    "from shared import thinkpython, diagram, jupyturtle\n",
    "from shared.download import download\n",
    "\n",
    "# Register as top-level modules so direct imports work in subsequent cells\n",
    "sys.modules['thinkpython'] = thinkpython\n",
    "sys.modules['diagram'] = diagram\n",
    "sys.modules['jupyturtle'] = jupyturtle"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "789ee19d",
   "metadata": {},
   "source": [
    "A **string** is a sequence of characters enclosed in quotes. A **character** can be a letter (in almost any alphabet), a digit, a punctuation mark, or white space. \n",
    "\n",
    "It should be noted that strings are immutable, meaning after creation, they cannot be modified or updated. \n",
    "\n",
    "Strings are one of the most commonly used data types in Python, and Python provides a rich set of built-in operations and methods for working with them.\n",
    "\n",
    "In this section we cover:\n",
    "\n",
    "- Creating strings\n",
    "- Indexing and slicing\n",
    "- Concatenation and repetition\n",
    "- Case methods\n",
    "- Searching and testing\n",
    "- Cleaning\n",
    "- Splitting and joining\n",
    "- String formatting\n",
    "- Type-checking methods\n",
    "- String comparison\n",
    "- Docstrings\n",
    "- Application"
   ]
  }
 ],
 "metadata": {
  "celltoolbar": "Tags",
  "kernelspec": {
   "display_name": ".venv (3.13.7)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
