{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "ea625414",
   "metadata": {},
   "source": [
    "# 11-14 · remove, pop, clear, del\n",
    "\n",
    "Praktyka do sekcji [«remove, pop, clear, del»](/pl/chapters/rozdzial-11/11-14-remove-pop-clear.html)."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "820cce63",
   "metadata": {},
   "source": [
    "## Cel\n",
    "\n",
    "Wybierz między remove(), pop() i del."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "236b478d",
   "metadata": {},
   "source": [
    "## Sprawa robocza"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "f4c17fc5",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-17T14:44:38.250109Z",
     "iopub.status.busy": "2026-08-17T14:44:38.249946Z",
     "iopub.status.idle": "2026-08-17T14:44:38.277125Z",
     "shell.execute_reply": "2026-08-17T14:44:38.276626Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['Anna', 'Maria']\n"
     ]
    }
   ],
   "source": [
    "names = [\"Anna\", \"Oleg\", \"Maria\"]\n",
    "names.remove(\"Oleg\")\n",
    "print(names)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a4a43244",
   "metadata": {},
   "source": [
    "## Podstawowa praktyka zadań ★\n",
    "\n",
    "Dano `names = [\"Anna\", \"Oleg\", \"Maria\", \"Leo\"]`. Usuń `\"Oleg\"` według wartości, następnie usuń i zapisz do `last` ostatni element przez pop(), następnie usuń pierwszy element przez `del`."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "f6aae1c7",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-17T14:44:38.278343Z",
     "iopub.status.busy": "2026-08-17T14:44:38.278178Z",
     "iopub.status.idle": "2026-08-17T14:44:38.280801Z",
     "shell.execute_reply": "2026-08-17T14:44:38.280357Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['Maria'] Leo\n"
     ]
    }
   ],
   "source": [
    "names = [\"Anna\", \"Oleg\", \"Maria\", \"Leo\"]\n",
    "names.remove(\"Oleg\")\n",
    "last = names.pop()\n",
    "del names[0]\n",
    "print(names, last)"
   ]
  }
 ],
 "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
}
