{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "25360584",
   "metadata": {},
   "source": [
    "# 13-17 · Stos wywołań\n",
    "\n",
    "Praktyka do sekcji [„Stos wywołań i traceback”"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "de89a6b7",
   "metadata": {},
   "source": [
    "## Cel\n",
    "\n",
    "Śledz kolejność wywołań i zwrotów w funkcjach zagnieżdżonych."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f948f49f",
   "metadata": {},
   "source": [
    "## Podstawowa praktyka zadań ★"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "ac59bad1",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-17T18:54:05.118528Z",
     "iopub.status.busy": "2026-08-17T18:54:05.118396Z",
     "iopub.status.idle": "2026-08-17T18:54:05.136745Z",
     "shell.execute_reply": "2026-08-17T18:54:05.136385Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "A\n",
      "B\n",
      "C\n",
      "Итог: 5\n"
     ]
    }
   ],
   "source": [
    "def c():\n",
    "    print(\"C\")\n",
    "    return 3\n",
    "\n",
    "def b():\n",
    "    print(\"B\")\n",
    "    return c() + 1\n",
    "\n",
    "def a():\n",
    "    print(\"A\")\n",
    "    return b() + 1\n",
    "\n",
    "result = a()\n",
    "print(\"Итог:\", result)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Cartesian Python 3.14",
   "language": "python",
   "name": "cartesian-python314"
  },
  "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.14.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
