{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "ca5d173d",
   "metadata": {},
   "source": [
    "# 14-06 · __init__ i tworzenie obiektu\n",
    "\n",
    "Praktyka do sekcji [„__init__ i tworzenie obiektu”"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "42fbaa4a",
   "metadata": {},
   "source": [
    "## Cel\n",
    "\n",
    "Domyślne wartości w __init__ i niezależność obiektu."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "50ffb34f",
   "metadata": {},
   "source": [
    "## Sprawa robocza"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "7877eea3",
   "metadata": {},
   "outputs": [],
   "source": [
    "class Sobaka:\n",
    "    def __init__(self, klichka, vozrast=1):\n",
    "        self.klichka = klichka\n",
    "        self.vozrast = vozrast\n",
    "\n",
    "shchenok = Sobaka(\"Бим\")\n",
    "rex = Sobaka(\"Рекс\", vozrast=3)\n",
    "print(shchenok.vozrast, rex.vozrast)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d1501194",
   "metadata": {},
   "source": [
    "## Podstawowa praktyka zadań ★\n",
    "\n",
    "Utwórz klasę `Student` z parametrami `imya` oraz `kurs=1` (domyślnie). Utwórz `s1` bez kursu i `s2` z kursem 3."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8365bf1c",
   "metadata": {},
   "outputs": [],
   "source": [
    "class Student:\n",
    "    def __init__(self, imya, kurs=1):\n",
    "        self.imya = imya\n",
    "        self.kurs = kurs\n",
    "\n",
    "s1 = Student(\"Аня\")\n",
    "s2 = Student(\"Боря\", 3)\n",
    "print(s1.kurs, s2.kurs)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Cartesian Python 3.14",
   "language": "python",
   "name": "cartesian-python314"
  },
  "language_info": {
   "name": "python",
   "version": "3.14.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
