{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "68175c76",
   "metadata": {},
   "source": [
    "# 05-01 · Основные математические операции\n",
    "\n",
    "Практика к разделу [«Основные математические операции»](../../site/chapters/glava-05/05-01-osnovnye-operacii.html)."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "28a92d93",
   "metadata": {},
   "source": [
    "## Цель\n",
    "\n",
    "Потренировать +, -, *, / на разных числах."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2aaafeec",
   "metadata": {},
   "source": [
    "## Рабочий пример"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "c99b2283",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-14T20:52:16.871034Z",
     "iopub.status.busy": "2026-08-14T20:52:16.870886Z",
     "iopub.status.idle": "2026-08-14T20:52:16.898412Z",
     "shell.execute_reply": "2026-08-14T20:52:16.897853Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "8\n",
      "2\n",
      "15\n",
      "1.6666666666666667\n"
     ]
    }
   ],
   "source": [
    "print(5 + 3)\n",
    "print(5 - 3)\n",
    "print(5 * 3)\n",
    "print(5 / 3)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5fb65a01",
   "metadata": {},
   "source": [
    "## Эксперимент 1\n",
    "\n",
    "Проверьте те же операции с отрицательными числами."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "f52dc2ce",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-14T20:52:16.899630Z",
     "iopub.status.busy": "2026-08-14T20:52:16.899511Z",
     "iopub.status.idle": "2026-08-14T20:52:16.901750Z",
     "shell.execute_reply": "2026-08-14T20:52:16.901400Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-2\n",
      "-15\n"
     ]
    }
   ],
   "source": [
    "print(-5 + 3)\n",
    "print(-5 * 3)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8048b344",
   "metadata": {},
   "source": [
    "## Эксперимент 2\n",
    "\n",
    "Смешайте переменные и операторы: посчитайте площадь прямоугольника 12 × 7."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "85b5fc0f",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-14T20:52:16.902911Z",
     "iopub.status.busy": "2026-08-14T20:52:16.902751Z",
     "iopub.status.idle": "2026-08-14T20:52:16.904902Z",
     "shell.execute_reply": "2026-08-14T20:52:16.904483Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "84\n"
     ]
    }
   ],
   "source": [
    "width = 12\n",
    "height = 7\n",
    "area = width * height\n",
    "print(area)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "979b103d",
   "metadata": {},
   "source": [
    "## Задание ★ Базовая практика\n",
    "\n",
    "Посчитайте, сколько получится сдачи, если товар стоит 350, а вы дали купюру в 500."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "d15260d5",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-14T20:52:16.905849Z",
     "iopub.status.busy": "2026-08-14T20:52:16.905740Z",
     "iopub.status.idle": "2026-08-14T20:52:16.907978Z",
     "shell.execute_reply": "2026-08-14T20:52:16.907472Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "150\n"
     ]
    }
   ],
   "source": [
    "price = 350\n",
    "paid = 500\n",
    "change = paid - price\n",
    "print(change)"
   ]
  }
 ],
 "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
}
