{"id":266,"date":"2024-08-31T09:05:32","date_gmt":"2024-08-31T09:05:32","guid":{"rendered":"https:\/\/techkubo.com\/python\/?p=266"},"modified":"2025-06-23T15:18:45","modified_gmt":"2025-06-23T15:18:45","slug":"python-object-oriented-programming","status":"publish","type":"post","link":"https:\/\/techkubo.com\/python\/python-object-oriented-programming\/","title":{"rendered":"Python Object-Oriented Programming"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Classes and Objects<\/h2>\n\n\n\n<p>Object-Oriented Programming (OOP) in Python allows you to define custom data types using classes. A class is a blueprint for creating objects, which are instances of the class.<\/p>\n\n\n\n<p><strong>Syntax<\/strong><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text\/x-python&quot;,&quot;theme&quot;:&quot;seti&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}\">class ClassName:\n    def __init__(self, attribute1, attribute2):\n        self.attribute1 = attribute1\n        self.attribute2 = attribute2\n\n    def method(self):\n        # Code for the method\n        pass<\/pre><\/div>\n\n\n\n<p><strong>Example<\/strong><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text\/x-python&quot;,&quot;theme&quot;:&quot;seti&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}\">class Car:\n    def __init__(self, brand, model):\n        self.brand = brand\n        self.model = model\n\n    def drive(self):\n        print(f&quot;The {self.brand} {self.model} is driving.&quot;)\n\ncar = Car(&quot;Toyota&quot;, &quot;Corolla&quot;)\ncar.drive()  # Output: The Toyota Corolla is driving.<\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The <code>__init__<\/code> method is a constructor that initializes the attributes of the class. Methods are functions defined inside the class that operate on its attributes.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Instance and Class Variables<\/h2>\n\n\n\n<p>Instance variables are unique to each object instance, while class variables are shared among all instances of a class.<\/p>\n\n\n\n<p><strong>Example<\/strong><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text\/x-python&quot;,&quot;theme&quot;:&quot;seti&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}\">class Car:\n    wheels = 4  # Class variable\n\n    def __init__(self, brand, model):\n        self.brand = brand  # Instance variable\n        self.model = model  # Instance variable\n\ncar1 = Car(&quot;Toyota&quot;, &quot;Corolla&quot;)\ncar2 = Car(&quot;Honda&quot;, &quot;Civic&quot;)\n\nprint(car1.wheels)  # Output: 4\nprint(car2.wheels)  # Output: 4<\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>wheels<\/code> is a class variable, so its value is shared by all instances of the <code>Car<\/code> class. <code>brand<\/code> and <code>model<\/code> are instance variables, unique to each <code>Car<\/code> object.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Pillars of OOP<\/h2>\n\n\n\n<p>Python supports the four main pillars of Object-Oriented Programming:<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-medium-font-size\">Encapsulation<\/h2>\n\n\n\n<p>Bundling the data (attributes) and methods (functions) that operate on the data into a single unit, or class.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text\/x-python&quot;,&quot;theme&quot;:&quot;seti&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}\">class Account:\n    def __init__(self, balance):\n        # Private attribute (encapsulated)\n        self.__balance = balance\n\n    def withdraw(self, amount):\n        try:\n            # Check if there's enough balance\n            if amount &gt; self.__balance:\n                raise ValueError(&quot;Insufficient funds&quot;)\n            # Deduct amount if valid\n            self.__balance -= amount\n        except ValueError as e:\n            # Handle insufficient funds\n            print(&quot;Error:&quot;, e)\n        else:\n            # Runs only if no exception occurs\n            print(f&quot;Withdrew: ${amount}&quot;)\n        finally:\n            # Always runs \u2014 show current balance\n            print(f&quot;Balance: ${self.__balance}&quot;)\n\n# Create an account with $100\na = Account(100)\n\n# First withdrawal: should succeed\na.withdraw(30)\n\n# Second withdrawal: should fail due to insufficient funds\na.withdraw(100)\n<\/pre><\/div>\n\n\n\n<p><strong>Example:<\/strong> demonstrates <strong>encapsulation<\/strong> by using a private attribute <code>__balance<\/code> inside an <code>Account<\/code> class. It also uses <code>try<\/code>, <code>except<\/code>, <code>else<\/code>, and <code>finally<\/code> blocks to safely handle withdrawals and exceptions like insufficient funds. The <code>finally<\/code> block ensures the balance is always printed, regardless of success or failure.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-medium-font-size\">Abstraction<\/h2>\n\n\n\n<p>Hiding the complex implementation details and exposing only the essential features of an object.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text\/x-python&quot;,&quot;theme&quot;:&quot;seti&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}\">from abc import ABC, abstractmethod\n\n# Abstract class\nclass Vehicle(ABC):\n    @abstractmethod\n    def drive(self):\n        pass\n\n# Concrete class\nclass Car(Vehicle):\n    def drive(self):\n        print(&quot;Car is driving...&quot;)\n\n# Using abstraction\nmy_car = Car()\nmy_car.drive()  # You don't need to know how it works internally\n<\/pre><\/div>\n\n\n\n<p><strong>Example:<\/strong> When you call the <code>drive()<\/code> method on a <code>Car<\/code> object, you don&#8217;t need to know how the method works internally.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-medium-font-size\">Inheritance<\/h2>\n\n\n\n<p>Creating a new class that is a modified version of an existing class. The new class inherits attributes and methods from the parent class.<\/p>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text\/x-python&quot;,&quot;theme&quot;:&quot;seti&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}\">class ElectricCar(Car):\n    def __init__(self, brand, model, battery_size):\n        super().__init__(brand, model)\n        self.battery_size = battery_size\n\n    def charge(self):\n        print(f&quot;The {self.brand} {self.model} is charging.&quot;)<\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Polymorphism<\/h2>\n\n\n\n<p>The ability to present the same interface for different underlying data types or classes.<\/p>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text\/x-python&quot;,&quot;theme&quot;:&quot;seti&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}\">class Dog:\n    def sound(self):\n        return &quot;Woof!\u201d\n\nclass Cat:\n    def sound(self):\n        return &quot;Meow!&quot;\n\ndef make_sound(animal):\n    print(animal.sound())\n\ndog = Dog()\ncat = Cat()\nmake_sound(dog)  # Output: Woof!\nmake_sound(cat)  # Output: Meow!<\/pre><\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Classes and Objects Object-Oriented Programming (OOP) in Python allows you to define custom data types using classes. A class is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[1],"tags":[],"class_list":["post-266","post","type-post","status-publish","format-standard","hentry","category-python"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Python Object-Oriented Programming - Python Tutorial<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/techkubo.com\/python\/python-object-oriented-programming\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python Object-Oriented Programming - Python Tutorial\" \/>\n<meta property=\"og:description\" content=\"Classes and Objects Object-Oriented Programming (OOP) in Python allows you to define custom data types using classes. A class is [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techkubo.com\/python\/python-object-oriented-programming\/\" \/>\n<meta property=\"og:site_name\" content=\"Python Tutorial\" \/>\n<meta property=\"article:published_time\" content=\"2024-08-31T09:05:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-23T15:18:45+00:00\" \/>\n<meta name=\"author\" content=\"Manong\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Manong\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/techkubo.com\/python\/python-object-oriented-programming\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/techkubo.com\/python\/python-object-oriented-programming\/\"},\"author\":{\"name\":\"Manong\",\"@id\":\"https:\/\/techkubo.com\/python\/#\/schema\/person\/b4fa2f01fa4ff2a4e98276ce47115965\"},\"headline\":\"Python Object-Oriented Programming\",\"datePublished\":\"2024-08-31T09:05:32+00:00\",\"dateModified\":\"2025-06-23T15:18:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/techkubo.com\/python\/python-object-oriented-programming\/\"},\"wordCount\":253,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/techkubo.com\/python\/#organization\"},\"articleSection\":[\"python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/techkubo.com\/python\/python-object-oriented-programming\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/techkubo.com\/python\/python-object-oriented-programming\/\",\"url\":\"https:\/\/techkubo.com\/python\/python-object-oriented-programming\/\",\"name\":\"Python Object-Oriented Programming - Python Tutorial\",\"isPartOf\":{\"@id\":\"https:\/\/techkubo.com\/python\/#website\"},\"datePublished\":\"2024-08-31T09:05:32+00:00\",\"dateModified\":\"2025-06-23T15:18:45+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/techkubo.com\/python\/python-object-oriented-programming\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/techkubo.com\/python\/python-object-oriented-programming\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/techkubo.com\/python\/python-object-oriented-programming\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/techkubo.com\/python\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python Object-Oriented Programming\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/techkubo.com\/python\/#website\",\"url\":\"https:\/\/techkubo.com\/python\/\",\"name\":\"Python Tutorial\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/techkubo.com\/python\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/techkubo.com\/python\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/techkubo.com\/python\/#organization\",\"name\":\"Python Tutorial\",\"url\":\"https:\/\/techkubo.com\/python\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/techkubo.com\/python\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/techkubo.com\/python\/wp-content\/uploads\/sites\/2\/2025\/01\/cropped-Techkubo-logo-1.png\",\"contentUrl\":\"https:\/\/techkubo.com\/python\/wp-content\/uploads\/sites\/2\/2025\/01\/cropped-Techkubo-logo-1.png\",\"width\":1620,\"height\":1156,\"caption\":\"Python Tutorial\"},\"image\":{\"@id\":\"https:\/\/techkubo.com\/python\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/techkubo.com\/python\/#\/schema\/person\/b4fa2f01fa4ff2a4e98276ce47115965\",\"name\":\"Manong\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/techkubo.com\/python\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/21a7455736c21887b8fefe0935012d65?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/21a7455736c21887b8fefe0935012d65?s=96&d=mm&r=g\",\"caption\":\"Manong\"},\"sameAs\":[\"https:\/\/techkubo.com\"],\"url\":\"https:\/\/techkubo.com\/python\/author\/manong\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python Object-Oriented Programming - Python Tutorial","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/techkubo.com\/python\/python-object-oriented-programming\/","og_locale":"en_US","og_type":"article","og_title":"Python Object-Oriented Programming - Python Tutorial","og_description":"Classes and Objects Object-Oriented Programming (OOP) in Python allows you to define custom data types using classes. A class is [&hellip;]","og_url":"https:\/\/techkubo.com\/python\/python-object-oriented-programming\/","og_site_name":"Python Tutorial","article_published_time":"2024-08-31T09:05:32+00:00","article_modified_time":"2025-06-23T15:18:45+00:00","author":"Manong","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Manong","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/techkubo.com\/python\/python-object-oriented-programming\/#article","isPartOf":{"@id":"https:\/\/techkubo.com\/python\/python-object-oriented-programming\/"},"author":{"name":"Manong","@id":"https:\/\/techkubo.com\/python\/#\/schema\/person\/b4fa2f01fa4ff2a4e98276ce47115965"},"headline":"Python Object-Oriented Programming","datePublished":"2024-08-31T09:05:32+00:00","dateModified":"2025-06-23T15:18:45+00:00","mainEntityOfPage":{"@id":"https:\/\/techkubo.com\/python\/python-object-oriented-programming\/"},"wordCount":253,"commentCount":0,"publisher":{"@id":"https:\/\/techkubo.com\/python\/#organization"},"articleSection":["python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/techkubo.com\/python\/python-object-oriented-programming\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/techkubo.com\/python\/python-object-oriented-programming\/","url":"https:\/\/techkubo.com\/python\/python-object-oriented-programming\/","name":"Python Object-Oriented Programming - Python Tutorial","isPartOf":{"@id":"https:\/\/techkubo.com\/python\/#website"},"datePublished":"2024-08-31T09:05:32+00:00","dateModified":"2025-06-23T15:18:45+00:00","breadcrumb":{"@id":"https:\/\/techkubo.com\/python\/python-object-oriented-programming\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techkubo.com\/python\/python-object-oriented-programming\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/techkubo.com\/python\/python-object-oriented-programming\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techkubo.com\/python\/"},{"@type":"ListItem","position":2,"name":"Python Object-Oriented Programming"}]},{"@type":"WebSite","@id":"https:\/\/techkubo.com\/python\/#website","url":"https:\/\/techkubo.com\/python\/","name":"Python Tutorial","description":"","publisher":{"@id":"https:\/\/techkubo.com\/python\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/techkubo.com\/python\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/techkubo.com\/python\/#organization","name":"Python Tutorial","url":"https:\/\/techkubo.com\/python\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techkubo.com\/python\/#\/schema\/logo\/image\/","url":"https:\/\/techkubo.com\/python\/wp-content\/uploads\/sites\/2\/2025\/01\/cropped-Techkubo-logo-1.png","contentUrl":"https:\/\/techkubo.com\/python\/wp-content\/uploads\/sites\/2\/2025\/01\/cropped-Techkubo-logo-1.png","width":1620,"height":1156,"caption":"Python Tutorial"},"image":{"@id":"https:\/\/techkubo.com\/python\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/techkubo.com\/python\/#\/schema\/person\/b4fa2f01fa4ff2a4e98276ce47115965","name":"Manong","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techkubo.com\/python\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/21a7455736c21887b8fefe0935012d65?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/21a7455736c21887b8fefe0935012d65?s=96&d=mm&r=g","caption":"Manong"},"sameAs":["https:\/\/techkubo.com"],"url":"https:\/\/techkubo.com\/python\/author\/manong\/"}]}},"_links":{"self":[{"href":"https:\/\/techkubo.com\/python\/wp-json\/wp\/v2\/posts\/266"}],"collection":[{"href":"https:\/\/techkubo.com\/python\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techkubo.com\/python\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techkubo.com\/python\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techkubo.com\/python\/wp-json\/wp\/v2\/comments?post=266"}],"version-history":[{"count":18,"href":"https:\/\/techkubo.com\/python\/wp-json\/wp\/v2\/posts\/266\/revisions"}],"predecessor-version":[{"id":783,"href":"https:\/\/techkubo.com\/python\/wp-json\/wp\/v2\/posts\/266\/revisions\/783"}],"wp:attachment":[{"href":"https:\/\/techkubo.com\/python\/wp-json\/wp\/v2\/media?parent=266"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techkubo.com\/python\/wp-json\/wp\/v2\/categories?post=266"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techkubo.com\/python\/wp-json\/wp\/v2\/tags?post=266"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}