About 39,000 results
Open links in new tab
  1. __init__ in Python - GeeksforGeeks

    Sep 12, 2025 · When an object is created, memory is allocated for it, and __init__ helps organize that memory by assigning values to attributes. Let’s look at some examples. You can pass multiple …

  2. Python __init__ () Method - W3Schools

    All classes have a built-in method called __init__(), which is always executed when the class is being initiated. The __init__() method is used to assign values to object properties, or to perform operations …

  3. Understand __init__ Method in Python

    Oct 7, 2025 · The __init__ method (pronounced “dunder init” – short for double underscore init) is a special method in Python classes that gets called automatically when you create a new object from a …

  4. Python __init__ () - Working and Examples

    __init__() is a built-in function in Python that is called whenever an object is created. It initializes the state for the object, meaning it's where we can set the attributes of an object.

  5. What is __init__ in Python? - Python Morsels

    Feb 11, 2021 · When you make a new class in Python the first method you'll likely make is the __init__ method. The __init__ method allows you to accept arguments to your class.

  6. Python __init__

    When you create a new object of a class, Python automatically calls the __init__() method to initialize the object’s attributes. Unlike regular methods, the __init__() method has two underscores (__) on …

  7. oop - What do __init__ and self do in Python? - Stack Overflow

    Jul 8, 2017 · The __init__ method is roughly what represents a constructor in Python. When you call A() Python creates an object for you, and passes it as the first parameter to the __init__ method.

  8. Understanding the `__init__` Function in Python - CodeRivers

    Apr 23, 2025 · The __init__ function in Python is a powerful and essential part of object-oriented programming. It allows you to initialize the state of objects, set up default values, and perform …

  9. Python __init__ Method - Complete Guide - ZetCode

    Apr 8, 2025 · The __init__ method is a special method in Python classes that initializes newly created objects. It's called automatically after the object is created by __new__.

  10. Python Class __init__ Method: Everything You Need to Know

    Feb 12, 2026 · That's where the `__init__` method comes in – it's a special method that Python calls when an object is instantiated from a class. I like to think of it as the "setup" method, where you get …