{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "7552b866",
   "metadata": {},
   "source": [
    "# 09-11 · Truthiness и None\n",
    "\n",
    "Практика к разделу [«Truthiness и None»](../../site/chapters/glava-09/09-11-truthiness-i-none.html)."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9df672e8",
   "metadata": {},
   "source": [
    "## Цель\n",
    "\n",
    "Освоить truthiness и правильную проверку на None."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ffade49b",
   "metadata": {},
   "source": [
    "## Рабочий пример"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "1b00bff3",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T17:23:03.414984Z",
     "iopub.status.busy": "2026-08-16T17:23:03.414875Z",
     "iopub.status.idle": "2026-08-16T17:23:03.437689Z",
     "shell.execute_reply": "2026-08-16T17:23:03.437176Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "True\n",
      "False\n"
     ]
    }
   ],
   "source": [
    "value = None\n",
    "print(value is None)\n",
    "print(bool(value))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2d54587a",
   "metadata": {},
   "source": [
    "## Задание ★ Базовая практика\n",
    "\n",
    "Проверьте value на None через `is`, и проверьте truthiness строки \"False\" и числа 0."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "76fc1cb1",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T17:23:03.438691Z",
     "iopub.status.busy": "2026-08-16T17:23:03.438579Z",
     "iopub.status.idle": "2026-08-16T17:23:03.440881Z",
     "shell.execute_reply": "2026-08-16T17:23:03.440531Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "True True False\n"
     ]
    }
   ],
   "source": [
    "value = None\n",
    "is_none = value is None\n",
    "truthy_check = bool(\"False\")\n",
    "falsy_check = bool(0)\n",
    "print(is_none, truthy_check, falsy_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
}
