{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "4820ef65",
   "metadata": {},
   "source": [
    "# 11-18 · zip() и распаковка\n",
    "\n",
    "Практика к разделу [«zip() и распаковка»](../../site/chapters/glava-11/11-18-zip-i-raspakovka.html)."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "640289be",
   "metadata": {},
   "source": [
    "## Цель\n",
    "\n",
    "Собрать словарь через zip() и распаковать пары в цикле."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0895ce52",
   "metadata": {},
   "source": [
    "## Рабочий пример"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "8d50c7ec",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-17T14:44:45.962496Z",
     "iopub.status.busy": "2026-08-17T14:44:45.962340Z",
     "iopub.status.idle": "2026-08-17T14:44:45.980745Z",
     "shell.execute_reply": "2026-08-17T14:44:45.980339Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Anna — 95\n",
      "Bob — 82\n"
     ]
    }
   ],
   "source": [
    "names = [\"Anna\", \"Bob\"]\n",
    "scores = [95, 82]\n",
    "for name, score in zip(names, scores):\n",
    "    print(name, \"—\", score)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2f8cac88",
   "metadata": {},
   "source": [
    "## Задание ★ Базовая практика\n",
    "\n",
    "Соберите словарь `itogi` из `names` и `scores` через `dict(zip(...))`, затем постройте список строк `stroki` вида `\"Имя: балл\"`, перебирая `itogi.items()`."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "894d4d5f",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-17T14:44:45.981998Z",
     "iopub.status.busy": "2026-08-17T14:44:45.981867Z",
     "iopub.status.idle": "2026-08-17T14:44:45.984535Z",
     "shell.execute_reply": "2026-08-17T14:44:45.984112Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'Anna': 95, 'Bob': 82, 'Maria': 91}\n",
      "['Anna: 95', 'Bob: 82', 'Maria: 91']\n"
     ]
    }
   ],
   "source": [
    "names = [\"Anna\", \"Bob\", \"Maria\"]\n",
    "scores = [95, 82, 91]\n",
    "itogi = dict(zip(names, scores))\n",
    "\n",
    "stroki = []\n",
    "for name, score in itogi.items():\n",
    "    stroki.append(f\"{name}: {score}\")\n",
    "\n",
    "print(itogi)\n",
    "print(stroki)"
   ]
  }
 ],
 "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
}
