{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "396fca76",
   "metadata": {},
   "source": [
    "# 04-01 · Liczby i zmienne\n",
    "\n",
    "Praktyka do sekcji [„Liczby w Python, zapisywanie liczb”"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ad12ac77",
   "metadata": {},
   "source": [
    "## Cel\n",
    "\n",
    "Nauczyć się zapisywać liczby w zmiennych i prawidłowo je nazywać."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "53c602e5",
   "metadata": {},
   "source": [
    "## Co trzeba wiedzieć\n",
    "\n",
    "`print()` jest znajomym rozkazem z rozdziałów 1 i 3."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c77b7e8f",
   "metadata": {},
   "source": [
    "## Krótkie przypomnienie\n",
    "\n",
    "Nazwa zmiennej — litery, cyfry, `_`; nie zaczyna się od liczby; styl — `snake_case`."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ae28ce4e",
   "metadata": {},
   "source": [
    "## Sprawa robocza"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "67dc314b",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-14T20:52:13.506478Z",
     "iopub.status.busy": "2026-08-14T20:52:13.506331Z",
     "iopub.status.idle": "2026-08-14T20:52:13.521569Z",
     "shell.execute_reply": "2026-08-14T20:52:13.521111Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "10\n",
      "11\n"
     ]
    }
   ],
   "source": [
    "age = 10\n",
    "print(age)\n",
    "\n",
    "age = 11  # значение можно заменить\n",
    "print(age)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a9060ea8",
   "metadata": {},
   "source": [
    "## Eksperyment 1\n",
    "\n",
    "Utwórz zmienną `city` z twoim miastem i ją wyeliminować."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "ff97e1b5",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-14T20:52:13.522603Z",
     "iopub.status.busy": "2026-08-14T20:52:13.522486Z",
     "iopub.status.idle": "2026-08-14T20:52:13.524849Z",
     "shell.execute_reply": "2026-08-14T20:52:13.524259Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Москва\n"
     ]
    }
   ],
   "source": [
    "city = \"Москва\"\n",
    "print(city)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c4ddf420",
   "metadata": {},
   "source": [
    "## Eksperyment 2\n",
    "\n",
    "Stwórz dwie zmienne i wyjmij ich sumę."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "d5e2e3fd",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-14T20:52:13.525861Z",
     "iopub.status.busy": "2026-08-14T20:52:13.525749Z",
     "iopub.status.idle": "2026-08-14T20:52:13.527904Z",
     "shell.execute_reply": "2026-08-14T20:52:13.527455Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "12\n"
     ]
    }
   ],
   "source": [
    "a = 5\n",
    "b = 7\n",
    "print(a + b)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9471cc4c",
   "metadata": {},
   "source": [
    "## Typowy błąd\n",
    "\n",
    "Nazwa zmiennej nie może zaczynać się od cyfry."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "289381a4",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-14T20:52:13.528874Z",
     "iopub.status.busy": "2026-08-14T20:52:13.528760Z",
     "iopub.status.idle": "2026-08-14T20:52:13.531391Z",
     "shell.execute_reply": "2026-08-14T20:52:13.530958Z"
    },
    "tags": [
     "raises-exception"
    ]
   },
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid decimal literal (2968492806.py, line 1)",
     "output_type": "error",
     "traceback": [
      "  \u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[4]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[31m    \u001b[39m\u001b[31m1_place = \"Cartesian\"\u001b[39m\n     ^\n\u001b[31mSyntaxError\u001b[39m\u001b[31m:\u001b[39m invalid decimal literal\n"
     ]
    }
   ],
   "source": [
    "1_place = \"Cartesian\""
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9c94df17",
   "metadata": {},
   "source": [
    "## Poprawka"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "d08a362c",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-14T20:52:13.532328Z",
     "iopub.status.busy": "2026-08-14T20:52:13.532230Z",
     "iopub.status.idle": "2026-08-14T20:52:13.534541Z",
     "shell.execute_reply": "2026-08-14T20:52:13.533827Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Cartesian\n"
     ]
    }
   ],
   "source": [
    "place_1 = \"Cartesian\"\n",
    "print(place_1)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5ddfc106",
   "metadata": {},
   "source": [
    "## Podstawowa praktyka zadań ★\n",
    "\n",
    "Tworzenie zmiennych `name`, `age`, `city` z danymi i wyjść je jednym poleceniem `print()` oddzielone przecinkami."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "f90e0202",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-14T20:52:13.535547Z",
     "iopub.status.busy": "2026-08-14T20:52:13.535437Z",
     "iopub.status.idle": "2026-08-14T20:52:13.537665Z",
     "shell.execute_reply": "2026-08-14T20:52:13.537258Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Cartesian 5 Москва\n"
     ]
    }
   ],
   "source": [
    "name = \"Cartesian\"\n",
    "age = 5\n",
    "city = \"Москва\"\n",
    "print(name, age, city)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a192f1d9",
   "metadata": {},
   "source": [
    "## Samodzielna praktyka ★★\n",
    "\n",
    "Policz ile dni w środku `age` lat (około 365 dni w roku), przechowując wynik w nowej zmiennej `days`."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "df8d2c3a",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-14T20:52:13.538583Z",
     "iopub.status.busy": "2026-08-14T20:52:13.538484Z",
     "iopub.status.idle": "2026-08-14T20:52:13.540598Z",
     "shell.execute_reply": "2026-08-14T20:52:13.540196Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "4380\n"
     ]
    }
   ],
   "source": [
    "age = 12\n",
    "days = age * 365\n",
    "print(days)"
   ]
  }
 ],
 "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
}
