coderz.py

Keep Coding Keep Cheering!

Constructor in Python

What is a Constructor? A constructor is a special method (function) used to initialize the class’s instance members. The main goal of constructors is to assign values to the class’s data members when an object of the class is created. Constructors are always called when an object is created, and the init() method simulates this. It […]

December 9, 2022 | python | No comments

Python Class

As we discussed in the previous tutorial, a class is a virtual entity that can be thought of as an object’s blueprint. The class was created when it was instantiated. Let us illustrate this with an example. Assume a class is a building prototype. A building contains all the information about the floor, rooms, doors, […]

December 8, 2022 | python | No comments

Advertisement