Why do we use __ init __ in python?



Why do we use __ init __ in python?..

Answer / Kuldeep Kumar Gupta

__init__ is a special method in Python classes that gets called when an object of the class is created (instantiated). It allows for initializing or setting default values for the object's attributes.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

How do you upgrade pip?

1 Answers  


Is it necessary to know c to learn python?

1 Answers  


In which field python is used?

1 Answers  


What is the accomplishment you are most proud of?

1 Answers  


How does the ternary operator work in python?

1 Answers  


What are the differences between python 2.x and python 3.x?

1 Answers  


Is python string mutable?

1 Answers  


How do you do data abstraction in python?

3 Answers  


How to count the occurrences of a particular element in the list?

1 Answers  


What exactly is SVM?

2 Answers  


What is class inheritance in python?

1 Answers  


What is the difference between range and arange in python?

1 Answers  


Categories