What is __ init __ in Python?

The __init__ method is similar to constructors in C++ and Java . Constructors are used to initialize the object’s state. The task of constructors is to initialize(assign values) to the data members of the class when an object of class is created.

Sizin İçin Seçtik  Why do we use constructors in JavaScript?

Leave a Reply

Your email address will not be published. Required fields are marked *