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

    Sep 12, 2025 · It runs automatically when a new object of a class is created. Its main purpose is to initialize the object’s attributes and set up its initial state. When an object is created, memory is …

  2. Python __init__ () Function - W3Schools

    All classes have a method called __init__ (), which is always executed when the class is being initiated. Use the __init__ () method to assign values to object properties, or other operations that are …

  3. Understand __init__ Method in Python

    Oct 7, 2025 · Learn how to use Python's __init__ method for object initialization. This guide covers basic usage, inheritance, validation techniques, and best practices.

  4. Python __init__

    In this tutorial, you'll learn how to use the Python __init__ () method to initialize objects.

  5. “What is __init__ in Python? Explained with Examples”

    Sep 2, 2024 · When you create an object (or instance) from a class, Python automatically calls the __init__ method to ensure that the object is initialized with the appropriate attributes. In essence, the …

  6. Python __init__ () - Working and Examples

    In this tutorial, we learned about the __init__() function in Python, how to use it in a class definition, and how to override the built-in __init__() function.

  7. Python __init__ () Function: Syntax, Usage, and Examples

    Learn how the Python __init__ () function works to initialize objects, handle parameters, and support inheritance with practical examples and best practices.

  8. Python __init__ Method - Complete Guide - ZetCode

    Apr 8, 2025 · This comprehensive guide explores Python's __init__ method, the special method responsible for object initialization. We'll cover basic usage, inheritance, default values, multiple …

  9. 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 …

  10. Python __init__ vs __new__ - GeeksforGeeks

    Jul 23, 2025 · Python __init__ __init__ method in Python is a special method known as the initializer or constructor. It is called automatically when a new instance (object) of a class is created. Its primary …