{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "0159747a",
   "metadata": {},
   "source": [
    "# 14-01 · Что такое ООП?\n",
    "\n",
    "Практика к разделу [«Что такое объектно-ориентированное программирование?»](../../site/chapters/glava-14/14-01-chto-takoe-oop.html)."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0d34d20e",
   "metadata": {},
   "source": [
    "## Цель\n",
    "\n",
    "Узнать объекты в уже знакомом коде."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "af88b38b",
   "metadata": {},
   "source": [
    "## Рабочий пример"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "80f10e01",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-17T19:47:42.665048Z",
     "iopub.status.busy": "2026-08-17T19:47:42.664937Z",
     "iopub.status.idle": "2026-08-17T19:47:42.684854Z",
     "shell.execute_reply": "2026-08-17T19:47:42.684359Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'str'>\n",
      "PYTHON\n"
     ]
    }
   ],
   "source": [
    "text = \"Python\"\n",
    "print(type(text))          # str — это класс\n",
    "print(text.upper())        # upper() — метод этого объекта"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "26aae2e8",
   "metadata": {},
   "source": [
    "## Эксперимент 1\n",
    "\n",
    "Проверьте класс нескольких уже знакомых объектов."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "2ba51847",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-17T19:47:42.685879Z",
     "iopub.status.busy": "2026-08-17T19:47:42.685767Z",
     "iopub.status.idle": "2026-08-17T19:47:42.688227Z",
     "shell.execute_reply": "2026-08-17T19:47:42.687784Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "42 -> <class 'int'>\n",
      "3.14 -> <class 'float'>\n",
      "текст -> <class 'str'>\n",
      "[1, 2, 3] -> <class 'list'>\n",
      "{'a': 1} -> <class 'dict'>\n"
     ]
    }
   ],
   "source": [
    "for value in [42, 3.14, \"текст\", [1, 2, 3], {\"a\": 1}]:\n",
    "    print(value, \"->\", type(value))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1c38efc0",
   "metadata": {},
   "source": [
    "## Задание ★ Базовая практика\n",
    "\n",
    "Найдите три метода у списка (глава 11) и объясните своими словами, что каждый из них делает."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "0577e397",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-17T19:47:42.689227Z",
     "iopub.status.busy": "2026-08-17T19:47:42.689117Z",
     "iopub.status.idle": "2026-08-17T19:47:42.691538Z",
     "shell.execute_reply": "2026-08-17T19:47:42.691018Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[4, 3, 2, 1]\n"
     ]
    }
   ],
   "source": [
    "numbers = [3, 1, 2]\n",
    "numbers.append(4)   # добавляет элемент\n",
    "numbers.sort()       # сортирует список\n",
    "numbers.reverse()    # разворачивает список\n",
    "print(numbers)"
   ]
  }
 ],
 "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
}
