Skip to content

amirkhan1092/Oops_python

Repository files navigation

Object-oriented programming (OOP) refers to a type of computer programming (software design) in which programmers define not only the data type of a data structure, but also the types of operations (functions) that can be applied to the data structure.

Python Classes/Objects

Python is an object oriented programming language. Almost everything in Python is an object, with its properties and methods.

Overview of OOP Terminology

Class − A class can be defined as a template/blueprint that describes the behavior/state that the object of its type support class is a user defined data type, which holds its own data members and member functions

Object Object is simply a collection of data (variables) and methods (functions) that act on those data. And, class is a blueprint for the object.

Instance variable − A variable that is defined inside a method and belongs only to the current instance of a class.

Class Variable* - A variable that is defined inside a class and shared by all instance of the class

Encapsulation - Hiding the private details of a class from other objects.

Inheritance − The transfer of the characteristics of a class to other classes that are derived from it.

Polymorphism - is an ability (in OOP) to use common interface for multiple form (data types).

Data Abstraction - Data abstraction and encapsulation are synonymous as data abstraction is achieved through encapsulation. Abstraction is used to hide internal details and show only functionalities. Abstracting something means to give names to things, so that the name captures the basic idea of what a function or a whole program does.

Instance − An individual object of a certain class. An object obj that belongs to a class Circle, for example, is an instance of the class Circle.

Instantiation − The creation of an instance of a class.

Method − A special kind of function that is defined in a class definition.

Operator overloading − The assignment of function to a particular operator. https://www.programiz.com/python-programming/operator-overloading

Function overloading − The assignment of more than one behavior to a particular function. The operation performed varies by the types of objects or arguments involved.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages