{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "22cc033b",
   "metadata": {},
   "source": [
    "# 05-11 · Скобки и формулы из переменных\n",
    "\n",
    "Практика к разделу [«Скобки и формулы из переменных»](../../site/chapters/glava-05/05-11-skobki-i-formuly.html)."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e2204b0e",
   "metadata": {},
   "source": [
    "## Цель\n",
    "\n",
    "Строить формулы из именованных переменных и не забывать скобки там, где они меняют смысл."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "41edc2fa",
   "metadata": {},
   "source": [
    "## Рабочий пример"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "f5b0b23d",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T12:02:51.988624Z",
     "iopub.status.busy": "2026-08-16T12:02:51.988512Z",
     "iopub.status.idle": "2026-08-16T12:02:52.005660Z",
     "shell.execute_reply": "2026-08-16T12:02:52.005171Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "18\n"
     ]
    }
   ],
   "source": [
    "shirina = 6\n",
    "vysota = 3\n",
    "perimetr = 2 * (shirina + vysota)\n",
    "print(perimetr)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ed4cfab1",
   "metadata": {},
   "source": [
    "## Задание ★ Базовая практика\n",
    "\n",
    "Посчитайте среднее трёх чисел a, b, c = 10, 20, 30 (не забудьте скобки вокруг суммы!) и выведите результат."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "e9a81a1b",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T12:02:52.006681Z",
     "iopub.status.busy": "2026-08-16T12:02:52.006565Z",
     "iopub.status.idle": "2026-08-16T12:02:52.009024Z",
     "shell.execute_reply": "2026-08-16T12:02:52.008599Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "20.0\n"
     ]
    }
   ],
   "source": [
    "a, b, c = 10, 20, 30\n",
    "srednee = (a + b + c) / 3\n",
    "print(srednee)"
   ]
  }
 ],
 "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
}
