CodeX
Published in

CodeX

Introduction to OOP in Python

Class Methods, Private Attributes, Information Hiding, Encapsulation and Singleton Design Pattern

Class Method Types

  1. Object Methods: We can use these methods from instantiated objects.
  2. Class Methods: We can use these methods from the classes directly.
  3. Static Methods: We can use these methods from both direct classes and instantiated objects.

Prepare A Class and Constructor Method

Object Methods

Class Methods

Static Methods

Information Hiding & Encapsulation

Private Attributes & Methods

Design Patterns

  • Creational Patterns
  • Structural Patterns
  • Behavioural Patterns

Singleton Pattern

Finally

--

--

Everything connected with Tech & Code. Follow to join our 1M+ monthly readers

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Baysan

Lifelong learner & Freelancer. I use technology that helps me. I’m currently working as a Business Intelligence & Backend Developer. mebaysan.com