{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "8ba7bcf9",
   "metadata": {},
   "source": [
    "# 09-19 · is против ==\n",
    "\n",
    "Практика к разделу [«is против ==»](../../site/chapters/glava-09/09-19-is-vs-ravno.html)."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f2da15ac",
   "metadata": {},
   "source": [
    "## Цель\n",
    "\n",
    "Правильно использовать is для None и == для значений."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c90be62a",
   "metadata": {},
   "source": [
    "## Рабочий пример"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "2dd9479d",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T17:23:09.946988Z",
     "iopub.status.busy": "2026-08-16T17:23:09.946885Z",
     "iopub.status.idle": "2026-08-16T17:23:09.970155Z",
     "shell.execute_reply": "2026-08-16T17:23:09.969633Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "True\n"
     ]
    }
   ],
   "source": [
    "value = None\n",
    "print(value is None)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "20a41446",
   "metadata": {},
   "source": [
    "## Задание ★ Базовая практика\n",
    "\n",
    "Проверьте None через is, и обычное числовое значение через ==."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "74df00d0",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T17:23:09.971742Z",
     "iopub.status.busy": "2026-08-16T17:23:09.971495Z",
     "iopub.status.idle": "2026-08-16T17:23:09.974211Z",
     "shell.execute_reply": "2026-08-16T17:23:09.973764Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "True True\n"
     ]
    }
   ],
   "source": [
    "value = None\n",
    "is_none_check = value is None\n",
    "\n",
    "value2 = 5\n",
    "equals_check = value2 == 5\n",
    "print(is_none_check, equals_check)"
   ]
  }
 ],
 "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
}
