{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "bc426f96",
   "metadata": {},
   "source": [
    "# 05-19 · choice, choices, sample, shuffle\n",
    "\n",
    "Praktyka do sekcji [„choice, choices, sample, shuffle”"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f70c2a14",
   "metadata": {},
   "source": [
    "## Cel\n",
    "\n",
    "Rozróżnić wybory z powtórzeniami (choices) i bez powtórzeń (sample)."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "82ee59f0",
   "metadata": {},
   "source": [
    "## Sprawa robocza"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "6e563299",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T12:02:58.615453Z",
     "iopub.status.busy": "2026-08-16T12:02:58.615260Z",
     "iopub.status.idle": "2026-08-16T12:02:58.641693Z",
     "shell.execute_reply": "2026-08-16T12:02:58.641267Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "камень\n"
     ]
    }
   ],
   "source": [
    "import random\n",
    "varianty = [\"камень\", \"ножницы\", \"бумага\"]\n",
    "print(random.choice(varianty))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "cd12b35e",
   "metadata": {},
   "source": [
    "## Podstawowa praktyka zadań ★\n",
    "\n",
    "Fix `random.seed(3)`, wtedy wyjść `random.sample(range(1, 6), k=3)` — trzy różne liczby bez powtórzeń (oczekiwane `[2, 5, 4]`)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "8a37f9aa",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T12:02:58.643217Z",
     "iopub.status.busy": "2026-08-16T12:02:58.643086Z",
     "iopub.status.idle": "2026-08-16T12:02:58.645491Z",
     "shell.execute_reply": "2026-08-16T12:02:58.645034Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[2, 5, 4]\n"
     ]
    }
   ],
   "source": [
    "import random\n",
    "random.seed(3)\n",
    "print(random.sample(range(1, 6), k=3))"
   ]
  }
 ],
 "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
}
