{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "6f90ce07",
   "metadata": {},
   "source": [
    "#04-06 · Duże liczby i niezmienność int\n",
    "\n",
    "Praktyka do sekcji [„int — liczby całkowite bez strachu”](/pl/chapters/rozdzial-04/04-06-int-glubzhe.html)."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "26878d8b",
   "metadata": {},
   "source": [
    "## Cel\n",
    "\n",
    "Zobaczyć dowolną precyzję int i sprawdzić niezmienność w praktyce."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0e400a6f",
   "metadata": {},
   "source": [
    "## Sprawa robocza"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "762412dc",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T10:03:16.956299Z",
     "iopub.status.busy": "2026-08-16T10:03:16.956178Z",
     "iopub.status.idle": "2026-08-16T10:03:16.977601Z",
     "shell.execute_reply": "2026-08-16T10:03:16.977096Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "100000000000000000000000000000000000000000000000000\n"
     ]
    }
   ],
   "source": [
    "huge = 10 ** 50\n",
    "print(huge)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "011687a2",
   "metadata": {},
   "source": [
    "## Eksperyment 1\n",
    "\n",
    "Przewidź: ile cyfr będzie w wyniku `10 ** 100`? Sprawdź `len(str(...))`."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "30d7ffcd",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T10:03:16.978591Z",
     "iopub.status.busy": "2026-08-16T10:03:16.978483Z",
     "iopub.status.idle": "2026-08-16T10:03:16.980782Z",
     "shell.execute_reply": "2026-08-16T10:03:16.980244Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "101\n"
     ]
    }
   ],
   "source": [
    "big = 10 ** 100\n",
    "print(len(str(big)))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "83a3fc5c",
   "metadata": {},
   "source": [
    "## Eksperyment 2\n",
    "\n",
    "Sprawdź niezmienność: stwórz `a`, skopiuj i wklej do `b`, zmiana `a` — `b` nie powinno się zmieniać."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "c28bb633",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T10:03:16.981944Z",
     "iopub.status.busy": "2026-08-16T10:03:16.981781Z",
     "iopub.status.idle": "2026-08-16T10:03:16.984621Z",
     "shell.execute_reply": "2026-08-16T10:03:16.984051Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "15\n",
      "10\n"
     ]
    }
   ],
   "source": [
    "a = 10\n",
    "b = a\n",
    "a += 5\n",
    "print(a)\n",
    "print(b)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f4b48c38",
   "metadata": {},
   "source": [
    "## Podstawowa praktyka zadań ★\n",
    "\n",
    "Wpisz populację kraju z podkreśleniami (np. 38_000_000) do zmiennej `population` i wyświetl ją."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "badd992c",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T10:03:16.985785Z",
     "iopub.status.busy": "2026-08-16T10:03:16.985630Z",
     "iopub.status.idle": "2026-08-16T10:03:16.988116Z",
     "shell.execute_reply": "2026-08-16T10:03:16.987607Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "38000000\n"
     ]
    }
   ],
   "source": [
    "population = 38_000_000\n",
    "print(population)"
   ]
  }
 ],
 "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
}
