Python is an object oriented programming language. Almost everything in Python is an object, with its properties and methods. A Class is like an object constructor, or a "blueprint" for creating objects. Class helps us to group and regroup some of the attributes and function in a way so that it could reuse at later point in the time.
Attributes & Methods:
values of an instance’s variables are called attributes and functions which are being associated with the instance called instance methods.
Constructor & Destructor:
A function or method which execute while defining an instance is call called constructor method, represented by __init__(). It takes instance as a first argument (which by convention we use ‘self’ as a placeholder for that instance). We could also pass other arguments after that using comma as separator.
Unlike constructor, destroyer method runs at last point (in the code, after which there is no uses of class or the instance defined under the same class, anymore). This is represented by __del__(). Destructor clears up class from the memory once the same class is no more in use, which save lot of space in memory.
You could find this tutorial’s presentation & code in the following links:
https://github.com/DeepHobbying/Basic...
https://github.com/DeepHobbying/Basic...
On this page of the site you can watch the video online Python OOP 1: Basic Class, Constructor (__init__) & Destructor (__del__) with a duration of hours minute second in good quality, which was uploaded by the user Deep Hobbying 10 August 2018, share the link with friends and acquaintances, this video has already been watched 2,049 times on youtube and it was liked by 22 viewers. Enjoy your viewing!