{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "fffd4bc6",
   "metadata": {},
   "source": [
    "#03-09 · Czytaj traceback: SyntaxError\n",
    "\n",
    "Praktyka do sekcji [„Typowe problemy i debugowanie”"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "83366838",
   "metadata": {},
   "source": [
    "## Cel\n",
    "\n",
    "Naucz się znajdować brakujący nawiasz lub cudzysłow w wiadomości `SyntaxError`."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "eccd8d58",
   "metadata": {},
   "source": [
    "## Co trzeba wiedzieć\n",
    "\n",
    "`SyntaxError` oznacza, że nie Python nawet zrozumiał struktury kodu — w ogóle nie został on wykonany."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "62ca0026",
   "metadata": {},
   "source": [
    "## Krótkie przypomnienie\n",
    "\n",
    "`SyntaxError` często wskazuje nie na sam sporny nawias/cudzysłów, lecz na miejsce, gdzie Python „się poddał” — czasem jest to następny łańcuch znaków. Warto przeczytać cały wiersz, a nie tylko wskazany znak."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1ad3b18a",
   "metadata": {},
   "source": [
    "## Rozgrzewka\n",
    "\n",
    "Zanim spojrzysz na błąd, uruchom jedną działającą komórkę — aby Python- środowisko było na pewno gotowe."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "17f6df85",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T02:04:23.923419Z",
     "iopub.status.busy": "2026-08-16T02:04:23.923288Z",
     "iopub.status.idle": "2026-08-16T02:04:23.957252Z",
     "shell.execute_reply": "2026-08-16T02:04:23.956896Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Готовы искать ошибки!\n"
     ]
    }
   ],
   "source": [
    "print(\"Готовы искать ошибки!\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "aaf49d17",
   "metadata": {},
   "source": [
    "## Sprawa robocza\n",
    "\n",
    "Brakuje tu nawiasu zamykającego."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "4a0010a3",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T02:04:23.958472Z",
     "iopub.status.busy": "2026-08-16T02:04:23.958361Z",
     "iopub.status.idle": "2026-08-16T02:04:23.960946Z",
     "shell.execute_reply": "2026-08-16T02:04:23.960463Z"
    },
    "tags": [
     "raises-exception"
    ]
   },
   "outputs": [
    {
     "ename": "_IncompleteInputError",
     "evalue": "incomplete input (1540670067.py, line 1)",
     "output_type": "error",
     "traceback": [
      "  \u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[2]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[31m    \u001b[39m\u001b[31mprint(\"Привет, Python!\"\u001b[39m\n                           ^\n\u001b[31m_IncompleteInputError\u001b[39m\u001b[31m:\u001b[39m incomplete input\n"
     ]
    }
   ],
   "source": [
    "print(\"Привет, Python!\""
   ]
  },
  {
   "cell_type": "markdown",
   "id": "293ba38d",
   "metadata": {},
   "source": [
    "## Poprawka"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "f680f058",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T02:04:23.961908Z",
     "iopub.status.busy": "2026-08-16T02:04:23.961799Z",
     "iopub.status.idle": "2026-08-16T02:04:23.963833Z",
     "shell.execute_reply": "2026-08-16T02:04:23.963463Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Привет, Python!\n"
     ]
    }
   ],
   "source": [
    "print(\"Привет, Python!\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c0bbc48d",
   "metadata": {},
   "source": [
    "## Eksperyment 1\n",
    "\n",
    "A tutaj brakuje cudzysłowu na zakończenie. Znajdź i popraw."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "5d817d75",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T02:04:23.964816Z",
     "iopub.status.busy": "2026-08-16T02:04:23.964715Z",
     "iopub.status.idle": "2026-08-16T02:04:23.967025Z",
     "shell.execute_reply": "2026-08-16T02:04:23.966581Z"
    },
    "tags": [
     "raises-exception"
    ]
   },
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "unterminated string literal (detected at line 1) (1195626594.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(\"Привет, Python!)\u001b[39m\n          ^\n\u001b[31mSyntaxError\u001b[39m\u001b[31m:\u001b[39m unterminated string literal (detected at line 1)\n"
     ]
    }
   ],
   "source": [
    "print(\"Привет, Python!)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "18139f3e",
   "metadata": {},
   "source": [
    "## Rozwiązanie eksperymentu 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "f4585b80",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T02:04:23.967943Z",
     "iopub.status.busy": "2026-08-16T02:04:23.967836Z",
     "iopub.status.idle": "2026-08-16T02:04:23.969823Z",
     "shell.execute_reply": "2026-08-16T02:04:23.969412Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Привет, Python!\n"
     ]
    }
   ],
   "source": [
    "print(\"Привет, Python!\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0f6f7a8b",
   "metadata": {},
   "source": [
    "## Podstawowa praktyka zadań ★\n",
    "\n",
    "Popraw oba błędy w wierszu poniżej — brakujący nawias ORAZ brakujący cytat — i przejdź bez błędów."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "b7a46003",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T02:04:23.970741Z",
     "iopub.status.busy": "2026-08-16T02:04:23.970584Z",
     "iopub.status.idle": "2026-08-16T02:04:23.972799Z",
     "shell.execute_reply": "2026-08-16T02:04:23.972441Z"
    },
    "tags": [
     "raises-exception"
    ]
   },
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "unterminated string literal (detected at line 1) (1350391576.py, line 1)",
     "output_type": "error",
     "traceback": [
      "  \u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[6]\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 unterminated string literal (detected at line 1)\n"
     ]
    }
   ],
   "source": [
    "print(\"Готово!"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6ff3ff5b",
   "metadata": {},
   "source": [
    "## Rozwiązywanie zadania\n",
    "📄"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "980acbcc",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T02:04:23.973813Z",
     "iopub.status.busy": "2026-08-16T02:04:23.973622Z",
     "iopub.status.idle": "2026-08-16T02:04:23.975695Z",
     "shell.execute_reply": "2026-08-16T02:04:23.975336Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Готово!\n"
     ]
    }
   ],
   "source": [
    "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
}
