Classes Objects in Python in Hindi | Lecture 12 | Mayank Gupta
This Python Tutorial in Hind by Mayank Gupta will teach you Object Oriented Programming in Python.
Today's Topics :
1. Python OOP
2. Defining class
3. Creating Objects
4. Attributes
5. Python constructor
6. Methods
7. Inheritance
8. Test Your skills
1. Python OOP
Python is an object oriented programming language.
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.
2. Defining class
A class is a blueprint for the object.
A class contains all the information about the object.
3. Creating Objects
Class defines the description of the object, not memory or storage is allocated for the class. Due to which object is created which is an instance of a class.
4. Attributes
The attributes are data members (class variables and instance variables) and methods. Attributes can be accessed via dot notation.
5. Python constructor
A constructor is a special type of method (function) which is used to initialize the instance members of the class. It is executed when the object of the class is created.
In python, All classes have a function called __init__(), which is always executed when the class is being initiated.
6. Methods
A special kind of function that is defined in a class definition.
__init()__ is also a method which is a class constructor.
We can also declare other class methods like normal functions with the exception that the first argument to each method is self.
7. Inheritance
Inheritance is the mechanism in which one class is allow to inherit the features(fields and methods) of another class. The new class is called derived (or child) class and the one from which it inherits is called the base (or parent) class.
8. Test Your skills
class transaction:
def __init__(self,sell,cost):
self.sell = sell
self.cost = cost
def profit(self):
return self.sell - self.cost
o1 = transaction(240,200)
print(o1.profit())
Please Like, Comment, Share and Subscribe to my Channel.
My profile : https://www.mayankgbrc.com
Thank You
Mayank Gupta
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Classes Objects in Python in Hindi | Lecture 12 | Mayank Gupta», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.