{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "f3172c42",
   "metadata": {},
   "source": [
    "# 11-15 · Списки и циклы\n",
    "\n",
    "Практика к разделу [«Списки и циклы»](../../site/chapters/glava-11/11-15-spiski-i-cikly.html)."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "dee45d44",
   "metadata": {},
   "source": [
    "## Цель\n",
    "\n",
    "Перебор списка, enumerate() и фильтрация по условию."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "fa9d55e1",
   "metadata": {},
   "source": [
    "## Рабочий пример"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "4866363d",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-17T14:44:40.181004Z",
     "iopub.status.busy": "2026-08-17T14:44:40.180845Z",
     "iopub.status.idle": "2026-08-17T14:44:40.201066Z",
     "shell.execute_reply": "2026-08-17T14:44:40.200614Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "95 — отлично!\n",
      "91 — отлично!\n"
     ]
    }
   ],
   "source": [
    "scores = [95, 82, 91, 58, 77]\n",
    "for score in scores:\n",
    "    if score >= 90:\n",
    "        print(score, \"— отлично!\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4b9ebf2a",
   "metadata": {},
   "source": [
    "## Задание ★ Базовая практика\n",
    "\n",
    "Из `scores` соберите список `otlichniki` (только оценки ≥ 90), и список пар `otlichniki_s_indeksami` — (индекс, оценка) для тех же значений, используя enumerate()."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "911ddbcf",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-17T14:44:40.202228Z",
     "iopub.status.busy": "2026-08-17T14:44:40.202061Z",
     "iopub.status.idle": "2026-08-17T14:44:40.204816Z",
     "shell.execute_reply": "2026-08-17T14:44:40.204406Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[95, 91]\n",
      "[(0, 95), (2, 91)]\n"
     ]
    }
   ],
   "source": [
    "scores = [95, 82, 91, 58, 77]\n",
    "\n",
    "otlichniki = []\n",
    "for score in scores:\n",
    "    if score >= 90:\n",
    "        otlichniki.append(score)\n",
    "\n",
    "otlichniki_s_indeksami = []\n",
    "for i, score in enumerate(scores):\n",
    "    if score >= 90:\n",
    "        otlichniki_s_indeksami.append((i, score))\n",
    "\n",
    "print(otlichniki)\n",
    "print(otlichniki_s_indeksami)"
   ]
  }
 ],
 "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
}
