{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "465ba891",
   "metadata": {},
   "source": [
    "# 03-01 · Tworzenie i uruchamianie programów\n",
    "\n",
    "Praktyka do sekcji [„Tworzenie i uruchamianie programów na Python”"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b388f4d2",
   "metadata": {},
   "source": [
    "## Cel\n",
    "\n",
    "Poczuj, jak kod zamienia się w wynik — tutaj komórka kodu pełni rolę „pliku i uruchom”"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3aabc120",
   "metadata": {},
   "source": [
    "## Co trzeba wiedzieć\n",
    "\n",
    "`print()` wyświetla tekst na ekranie, znane polecenie z Rozdziału 1."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ba514278",
   "metadata": {},
   "source": [
    "## Krótkie przypomnienie\n",
    "\n",
    "W rzeczywistości `.py`pliku -file kod jest uruchamiany za pomocą polecenia `python имя_файла.py`. Tutaj do ćwiczeń każda komórka jest jak mały osobny program."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0a560c52",
   "metadata": {},
   "source": [
    "## Sprawa robocza"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "c60ba8f1",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-14T20:52:10.131031Z",
     "iopub.status.busy": "2026-08-14T20:52:10.130885Z",
     "iopub.status.idle": "2026-08-14T20:52:10.153383Z",
     "shell.execute_reply": "2026-08-14T20:52:10.152927Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Привет, Python!\n"
     ]
    }
   ],
   "source": [
    "print(\"Привет, Python!\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "985f4f27",
   "metadata": {},
   "source": [
    "## Eksperyment 1\n",
    "\n",
    "Zmień tekst powitania na swój."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "17f3fd57",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-14T20:52:10.154384Z",
     "iopub.status.busy": "2026-08-14T20:52:10.154265Z",
     "iopub.status.idle": "2026-08-14T20:52:10.156380Z",
     "shell.execute_reply": "2026-08-14T20:52:10.155951Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Привет, Cartesian School!\n"
     ]
    }
   ],
   "source": [
    "print(\"Привет, Cartesian School!\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "46ea8c61",
   "metadata": {},
   "source": [
    "## Eksperyment 2\n",
    "\n",
    "Dodaj drugi wiersz `print()` z twoim imieniem."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "f5902eb4",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-14T20:52:10.157289Z",
     "iopub.status.busy": "2026-08-14T20:52:10.157181Z",
     "iopub.status.idle": "2026-08-14T20:52:10.159775Z",
     "shell.execute_reply": "2026-08-14T20:52:10.158973Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Привет, Python!\n",
      "Меня зовут Cartesian\n"
     ]
    }
   ],
   "source": [
    "print(\"Привет, Python!\")\n",
    "print(\"Меня зовут Cartesian\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "edaba4be",
   "metadata": {},
   "source": [
    "## Typowy błąd\n",
    "\n",
    "W bardzo starych podręcznikach Python 2 można znaleźć `print \"Привет\"` bez nawiasów — w Python 3 (a tym bardziej w 3.14) to błąd składni."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "ad1031d2",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-14T20:52:10.161145Z",
     "iopub.status.busy": "2026-08-14T20:52:10.161003Z",
     "iopub.status.idle": "2026-08-14T20:52:10.163553Z",
     "shell.execute_reply": "2026-08-14T20:52:10.163078Z"
    },
    "tags": [
     "raises-exception"
    ]
   },
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "Missing parentheses in call to 'print'. Did you mean print(...)? (1407130998.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[31mprint \"Привет\"\u001b[39m\n    ^\n\u001b[31mSyntaxError\u001b[39m\u001b[31m:\u001b[39m Missing parentheses in call to 'print'. Did you mean print(...)?\n"
     ]
    }
   ],
   "source": [
    "print \"Привет\""
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a77199a0",
   "metadata": {},
   "source": [
    "## Poprawka\n",
    "\n",
    "W Python 3 `print` — zwykła funkcja, argument przekazuje się w nawiasach."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "491d9a4e",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-14T20:52:10.164614Z",
     "iopub.status.busy": "2026-08-14T20:52:10.164508Z",
     "iopub.status.idle": "2026-08-14T20:52:10.166535Z",
     "shell.execute_reply": "2026-08-14T20:52:10.166128Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Привет\n"
     ]
    }
   ],
   "source": [
    "print(\"Привет\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "672df4c2",
   "metadata": {},
   "source": [
    "## Podstawowa praktyka zadań ★\n",
    "\n",
    "Wyświetl trzy wiersze: swoje imię, swoje miasto i ulubioną liczbę."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "d683ef5a",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-14T20:52:10.167459Z",
     "iopub.status.busy": "2026-08-14T20:52:10.167344Z",
     "iopub.status.idle": "2026-08-14T20:52:10.169518Z",
     "shell.execute_reply": "2026-08-14T20:52:10.169001Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Cartesian\n",
      "Москва\n",
      "42\n"
     ]
    }
   ],
   "source": [
    "print(\"Cartesian\")\n",
    "print(\"Москва\")\n",
    "print(42)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "db323c61",
   "metadata": {},
   "source": [
    "## Samodzielna praktyka ★★\n",
    "\n",
    "Wygeneruj krótki dwuwiersz lub cytat — co najmniej dwa wersy — używając dwóch oddzielnych wywołań `print()`."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "e6349230",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-14T20:52:10.170468Z",
     "iopub.status.busy": "2026-08-14T20:52:10.170360Z",
     "iopub.status.idle": "2026-08-14T20:52:10.172606Z",
     "shell.execute_reply": "2026-08-14T20:52:10.172234Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Код за кодом, шаг за шагом —\n",
      "так рождается программа.\n"
     ]
    }
   ],
   "source": [
    "print(\"Код за кодом, шаг за шагом —\")\n",
    "print(\"так рождается программа.\")"
   ]
  }
 ],
 "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
}
