{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "9ca92118-63ae-4e99-b618-a300f7c50507",
   "metadata": {},
   "source": [
    "### Poznámky z prvního cvičení ZPRO doplněné o komentáře\n",
    "- komentáře v kódu jsou uvozené #"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "ed0ce8cd-e9a1-4c50-9b46-e31540e5f8a3",
   "metadata": {},
   "outputs": [],
   "source": [
    "# JupyterLab, domovský adresář, práce se soubory\n",
    "# Launcher - Notebook (.ipynb), Console, Other (Terminal, Text File, Python File - .py)\n",
    "# Interpret (\"Kernel\") - když otevřeme notebook nebo konzoli, přiřadí se k němu nový interpret (proces),\n",
    "#                      - v JupyterLabu se značí jako Kernel (mrkněte na záložku 'Kernel')\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "18fdd42a-7a48-4d72-afbf-0f3d7cea834b",
   "metadata": {},
   "source": [
    "### Aritmetické výrazy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "976e4b3c-6de1-4774-a3ce-adef659cae9d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-2.76"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# python jako kalkulačka (např. v konzoli)\n",
    "4 + 3\n",
    "7 - 4\n",
    "5 * 6 - 7 / 2    # základní operace (pozor na prioritu a asocoativitu operátorů)\n",
    "16 / (2 + 3)     # závorky\n",
    "2.3 * -1.2       # desetinná a záporná čísla\n",
    "2 ** 3           # mocnina\n",
    "2 ** 0.5         # odmocnina"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "dc8cf499-7c80-40b7-a7a9-2c7297b62239",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1.0"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "2 ** 1 / 2      # pozor, ** váže víc než / : 2 ** (1 / 2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "id": "67a92bbb-ba5b-454c-a808-c124c8d91c84",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "10 - 3 - 4      # asociativita zleva: (10 - 3) - 4 \n",
    "                # 10 - (3 - 4) \n",
    "                # "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "813f09db-c9d5-4c81-8cca-7ddbfbb68b7b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# rozšíření látky: další aritmetické operace\n",
    "32 / 5           # dělení\n",
    "32 // 5          # celočíselné dělení\n",
    "32 % 5           # zbytek po celočíselném dělení"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "039b3706-1cfe-47f2-ae84-e1617e163771",
   "metadata": {},
   "source": [
    "### Proměnné"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "b9eecedf-9bde-48f5-ab0a-d20230183fc3",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'a' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[31m---------------------------------------------------------------------------\u001b[39m",
      "\u001b[31mNameError\u001b[39m                                 Traceback (most recent call last)",
      "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[3]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[32m----> \u001b[39m\u001b[32m1\u001b[39m a          \u001b[38;5;66;03m# chyba (proměnná ahoj není definovaná)\u001b[39;00m\n",
      "\u001b[31mNameError\u001b[39m: name 'a' is not defined"
     ]
    }
   ],
   "source": [
    "a          # chyba (proměnná a není definovaná)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "2759aee2-7c0b-49a7-91d9-4b5691aaf3bf",
   "metadata": {},
   "outputs": [],
   "source": [
    "# proměnné\n",
    "# a          # chyba\n",
    "a = 10       # přiřadím hodnotu do proměnné, nic se nevypíše"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "8cdbccf3-b061-469c-aefb-57e70a30dad7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a           # vypíšu hodnotu proměnné"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "09f18137-9e1e-4c2b-9fb3-b82c0297e684",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "4.5"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# změním hodnotu proměnné \n",
    "# vyhodnotí se výraz vpravo od '=', výsledek se vloží do proměnné\n",
    "a = 1.5 * 3  \n",
    "a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "bd521459-0289-441e-9b96-58daee2afc69",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "7"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# více příkazů v 1 buňce\n",
    "#  provedou se všechny, ale vypíše se jen hodnota posledního výrazu\n",
    "a = 12\n",
    "b = 4\n",
    "c = 7\n",
    "a              \n",
    "b\n",
    "c"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "4f1927e5-e9d4-4970-bf12-b4c686105c4e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "16"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "c = 5 * b - a  \n",
    "c\n",
    "c = 2 * c\n",
    "c"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "39266c2f-3093-450e-94d9-cfd316f2bf29",
   "metadata": {},
   "source": [
    "### Funkce print"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "d915ac89-2f0b-4c34-bdef-747dac871c50",
   "metadata": {
    "editable": true,
    "slideshow": {
     "slide_type": ""
    },
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "4\n",
      "16\n",
      "0.4\n",
      "ahoj\n"
     ]
    }
   ],
   "source": [
    "# print ... funkce pro výpis hodnot na standardní výstup\n",
    "print(4)\n",
    "print(c)\n",
    "print(4 / 10)   # vyhodnotí se výraz, vypíše se výsledek\n",
    "print(\"ahoj\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "id": "6c779979-c9a9-461f-8337-4cfd2817eb49",
   "metadata": {
    "editable": true,
    "slideshow": {
     "slide_type": ""
    },
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "4\n",
      "4 5 4 2.8000000000000003 1.7777777777777777 pepa\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "4"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# funkce print může mít více parametrů, pak je vypíše vedle sebe \n",
    "# oddělené mezerou a nakonec odřádkuje\n",
    "x = 4\n",
    "y = 5 - 3\n",
    "c = \"pepa\"\n",
    "print(x)\n",
    "print(4, 5, x, 7 * 0.4, (x / 3) ** y,  c)\n",
    "x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "id": "a3750c5b-37e8-429e-b813-6b710e1ed5bc",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Výsledek pro x =  4 je 16 .\n"
     ]
    }
   ],
   "source": [
    "# výpis celých vět\n",
    "print(\"Výsledek pro x = \", x, \"je\", x ** 2, \".\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "d9b9bd7a-453f-4d34-861a-87169385166f",
   "metadata": {
    "editable": true,
    "slideshow": {
     "slide_type": ""
    },
    "tags": []
   },
   "outputs": [],
   "source": [
    "# nápověda pro funkce pomocí klávesy TAB a dále \"Help->Show Contextual Help\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "75b241d5-3f58-40d3-8276-cd59262dc920",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "3 4.3 -7\n",
      "3, 4.3, -7\n",
      "3, 4.3, -7 ... \n"
     ]
    }
   ],
   "source": [
    "# rozšíření látky: print pro pokročilé\n",
    "x = 3\n",
    "y = 4.3\n",
    "z = -7\n",
    "print(x, y, z)\n",
    "print(x,y,z, sep=', ')  # oddělovač nebude ' ', ale ','\n",
    "print(x,y,z, sep=', ', end = ' ... \\n') # jiný ukončovací řetězec než odřádkování"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6eefb192-3de3-4617-97c4-9fe22c15e842",
   "metadata": {},
   "source": [
    "### Chyby"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "b217c217-40ac-4b59-9659-3f6ae031d3d0",
   "metadata": {
    "editable": true,
    "slideshow": {
     "slide_type": ""
    },
    "tags": []
   },
   "outputs": [
    {
     "ename": "_IncompleteInputError",
     "evalue": "incomplete input (3415391934.py, line 4)",
     "output_type": "error",
     "traceback": [
      "  \u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[23]\u001b[39m\u001b[32m, line 4\u001b[39m\n\u001b[31m    \u001b[39m\u001b[31mprint(x, y, c\u001b[39m\n                 ^\n\u001b[31m_IncompleteInputError\u001b[39m\u001b[31m:\u001b[39m incomplete input\n"
     ]
    }
   ],
   "source": [
    "# syntaktická chyba (chybí ukončovací závorka)\n",
    "# prohlédněte si chybový výpis: na jakém řádku chyba nastala, popis chyby\n",
    "# interpret se neukončí, pouze přeruší provádění buňky\n",
    "print(x, y, c"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "de71763a-945c-48f7-8485-6c94066b6425",
   "metadata": {
    "editable": true,
    "slideshow": {
     "slide_type": ""
    },
    "tags": []
   },
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid syntax. Perhaps you forgot a comma? (1482002708.py, line 2)",
     "output_type": "error",
     "traceback": [
      "  \u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[17]\u001b[39m\u001b[32m, line 2\u001b[39m\n\u001b[31m    \u001b[39m\u001b[31mprint(x y)\u001b[39m\n          ^\n\u001b[31mSyntaxError\u001b[39m\u001b[31m:\u001b[39m invalid syntax. Perhaps you forgot a comma?\n"
     ]
    }
   ],
   "source": [
    "# syntaktická chyba (chybí čárka)\n",
    "print(x y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "0b3bd946-b455-4510-8032-a7c92d6a74e7",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'Print' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[31m---------------------------------------------------------------------------\u001b[39m",
      "\u001b[31mNameError\u001b[39m                                 Traceback (most recent call last)",
      "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[22]\u001b[39m\u001b[32m, line 2\u001b[39m\n\u001b[32m      1\u001b[39m \u001b[38;5;66;03m# syntaktická chyba (překlep v názvu funkce)\u001b[39;00m\n\u001b[32m----> \u001b[39m\u001b[32m2\u001b[39m Print(x, y)\n",
      "\u001b[31mNameError\u001b[39m: name 'Print' is not defined"
     ]
    }
   ],
   "source": [
    "# syntaktická chyba (překlep v názvu funkce)\n",
    "Print(x, y)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "39a6c491-1ca8-4313-bcc4-33e627780f7f",
   "metadata": {},
   "source": [
    "### Funkce input()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "d7c5e5af-4063-4d7d-ba1b-c69dfecc310f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdin",
     "output_type": "stream",
     "text": [
      "Jak se jmenujes? zuzka\n"
     ]
    }
   ],
   "source": [
    "# input ... čtení uživatelského vstupu ve formě textu\n",
    "x = input(\"Jak se jmenujes?\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "d651df68-7d98-472e-bb55-7a716003c60d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'zuzka'"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# funkce input() vrací textový řetězec (string)\n",
    "x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "8b52909a-8bd8-43d9-ac7e-98ed3e6fde4f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdin",
     "output_type": "stream",
     "text": [
      "Jak se jmenujes? zuzka\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Jmenujes se zuzka .\n"
     ]
    }
   ],
   "source": [
    "# celý příklad\n",
    "x = input(\"Jak se jmenuješ?\")\n",
    "print(\"Jmenuješ se\", x, \".\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "567fa618-ed6f-4a2f-bfc2-89a85c4828e5",
   "metadata": {},
   "outputs": [
    {
     "name": "stdin",
     "output_type": "stream",
     "text": [
      " 478\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "'478'"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# funkci input můžeme volat i bez parametru\n",
    "x = input()\n",
    "x\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "620b3877-fe66-4251-b7f4-15f3c5a6d19d",
   "metadata": {},
   "outputs": [
    {
     "name": "stdin",
     "output_type": "stream",
     "text": [
      "Zadej cislo 412\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "412\n",
      "412412412412412\n"
     ]
    },
    {
     "ename": "TypeError",
     "evalue": "unsupported operand type(s) for -: 'str' and 'int'",
     "output_type": "error",
     "traceback": [
      "\u001b[31m---------------------------------------------------------------------------\u001b[39m",
      "\u001b[31mTypeError\u001b[39m                                 Traceback (most recent call last)",
      "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[32]\u001b[39m\u001b[32m, line 5\u001b[39m\n\u001b[32m      1\u001b[39m \u001b[38;5;66;03m# funkce input() vždy vrací textový řetězec (string)\u001b[39;00m\n\u001b[32m      2\u001b[39m y = input(\u001b[33m\"Zadej cislo\"\u001b[39m)\n\u001b[32m      3\u001b[39m print(y)\n\u001b[32m      4\u001b[39m print (y * \u001b[32m5\u001b[39m)\n\u001b[32m----> \u001b[39m\u001b[32m5\u001b[39m y - \u001b[32m4\u001b[39m \u001b[38;5;66;03m# chyba\u001b[39;00m\n",
      "\u001b[31mTypeError\u001b[39m: unsupported operand type(s) for -: 'str' and 'int'"
     ]
    }
   ],
   "source": [
    "# funkce input() vždy vrací textový řetězec (string)\n",
    "y = input(\"Zadej cislo\")\n",
    "print(y)\n",
    "print (y * 5)  # projde, ale zřetězí stringy namísto násobení\n",
    "y - 4          # zde program zhavaruje"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "aab06d4b-e57d-4356-9c90-aacd3e1f02b0",
   "metadata": {
    "editable": true,
    "slideshow": {
     "slide_type": ""
    },
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'412'"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# doplnění ... proměnné a hodnoty mohou být různého typu \n",
    "# (číslo - int, float, bool, textový řetězec - str)\n",
    "# stringy:\n",
    "'ahoj lidi'\n",
    "\"ahoj lidi\"\n",
    "'78'\n",
    "y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "id": "66c11efd-042d-46ab-b335-b14fe95d3a06",
   "metadata": {
    "editable": true,
    "slideshow": {
     "slide_type": ""
    },
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'ahojsvěte'"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# operátory se chovají jinak pro čísla a jinak pro stingy\n",
    "a = \"ahoj\"\n",
    "b = \"světe\"\n",
    "a + b  # zřetězení"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "d2d18029-fe53-4f3b-bf4a-53a1eaef15b1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'ahojahojahoj'"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "3 * a  # násobné zřetězení"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "86edbda2-3238-4a73-b65b-660b2f892a6a",
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "unsupported operand type(s) for +: 'int' and 'str'",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[0;32mIn[23], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[38;5;241;43m3\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;241;43m+\u001b[39;49m\u001b[43m \u001b[49m\u001b[43ma\u001b[49m \u001b[38;5;66;03m# chyba, operátor není definován pro int a str\u001b[39;00m\n",
      "\u001b[0;31mTypeError\u001b[0m: unsupported operand type(s) for +: 'int' and 'str'"
     ]
    }
   ],
   "source": [
    "3 + a # chyba, operátor + není definován pro int a str"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "id": "1d3e00f7-ce8b-42b7-a871-1be04ec27719",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "408"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Funkce int() pro převod ze stringu na celé číslo:\n",
    "y = int(y)\n",
    "y - 4"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "1ed630bb-1368-47f0-aba3-432fbe58bf0d",
   "metadata": {
    "editable": true,
    "slideshow": {
     "slide_type": ""
    },
    "tags": []
   },
   "outputs": [],
   "source": [
    "# notebook a buňky různého typu (zdrojový kód v Pythonu, markdown text)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ee6da86f-e26e-4998-befe-dd935f590661",
   "metadata": {},
   "source": [
    "### Markdown buňka\n",
    "- takhle vypadá když ho NEnaformátuji (\"buňku NEspustím\")\n",
    "- mrkněte na Help -> Markdown Reference "
   ]
  },
  {
   "cell_type": "markdown",
   "id": "752907a7-5a5c-408d-ac07-d79a1d84108e",
   "metadata": {},
   "source": [
    "### Markdown buňka\n",
    "- takhle vypadá když ho naformátuji (\"buňku spustím\")\n",
    "- mrkněte na Help -> Markdown Reference "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "afcecb82-e28a-4549-940d-29465023c4f2",
   "metadata": {},
   "outputs": [],
   "source": [
    "# různé způsoby, jak pustit buňku (Shift+ENTER, Ctrl+ENTER, tlačítko, nabídka Run)  )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "094594fd-f9ed-43b0-8c22-ca86f0371ad9",
   "metadata": {},
   "outputs": [],
   "source": [
    "# příklad: zeptejte se uživatele na rok \n",
    "# vypište, kolik let uplynulo od daneho roku\n",
    "# bude se hodit: input, int, print"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "id": "ec6ca032-e3e5-4191-8b98-6ffa4f26504d",
   "metadata": {},
   "outputs": [
    {
     "name": "stdin",
     "output_type": "stream",
     "text": [
      "Zadej rok 1457\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Od roku 1457 uplynulo 569 let.\n"
     ]
    }
   ],
   "source": [
    "s = input(\"Zadej rok\")\n",
    "rok = int(s)\n",
    "vysledek = 2026 - rok\n",
    "print(\"Od roku\", s, \"uplynulo\", vysledek, \"let.\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "426535ec-8edd-4530-b730-638ec8d7fe65",
   "metadata": {},
   "outputs": [
    {
     "name": "stdin",
     "output_type": "stream",
     "text": [
      "zadej rok 145\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "'145'"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# funkce input vrací string\n",
    "rok = input(\"zadej rok\")\n",
    "rok"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1bd1c22a-f2f6-463b-84cc-c9d579d61118",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "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.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
