{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "class MyClass(object):\n",
    "    \n",
    "    # special method that initializes an instance of my_class\n",
    "    def __init__(self, a, b, c, ...):\n",
    "        self.attribute_1 = a\n",
    "        self.attribute_2 = b\n",
    "        self.attribute_3 = c\n",
    "        ..."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "(0,0)\n",
      "(3,5)\n"
     ]
    }
   ],
   "source": [
    "class Point(object):\n",
    "    def __init__(self, x_value=0, y_value=0):\n",
    "        self.x = x_value\n",
    "        self.y = y_value\n",
    "        \n",
    "    def __str__(self):\n",
    "        return \"(\" + str(self.x) + \",\" + str(self.y) + \")\"\n",
    "    \n",
    "a = Point()\n",
    "print(a)\n",
    "b = Point(3, 5)\n",
    "print(b)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "from math import pi\n",
    "\n",
    "class Circle(object):    \n",
    "    def __init__(self, c=Point(0,0), r=1):\n",
    "        self.center = c\n",
    "        self.radius = r\n",
    "    \n",
    "    def diameter(self):\n",
    "        return 2*self.radius\n",
    "    \n",
    "    def perimeter(self):\n",
    "        return 2*pi*self.radius\n",
    "    \n",
    "    def area(self):\n",
    "        return pi*self.radius**2\n",
    "    \n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "2\n",
      "6.283185307179586\n",
      "3.141592653589793\n"
     ]
    }
   ],
   "source": [
    "C = Circle()\n",
    "print(C.diameter())\n",
    "print(C.perimeter())\n",
    "print(C.area())\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "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.13.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
