H2K Infosys Forum

What is the purpose...
 
Notifications
Clear all

What is the purpose of the __init__() method in Python classes?

 
Member Moderator

__init__() initializes an object’s attributes when the object is created. It acts like a constructor and is a fundamental concept taught in certificate python programming courses because it helps learners understand how objects are set up internally.

 
class Car:
def __init__(self, brand):
self.brand = brand

Quote
Topic starter Posted : 19/11/2025 5:39 am
Share: