A key point that others have referred to but I want to emphasize a bit more, as it seems to be at the root of a lot of your confusion here and is crucial for understanding what’s going on here, is understanding the difference between a class and an instance of a class. Let’s suppose we have the foll… Answer from CAM-Gerlach on discuss.python.org
W3Schools
w3schools.com › Python › python_class_init.asp
Python __init__() Method
Python Examples Python Compiler ... ... All classes have a built-in method called __init__(), which is always executed when the class is being initiated....
Stack Overflow
stackoverflow.com › questions › 8609153 › why-do-we-use-init-in-python-classes
class - Why do we use __init__ in Python classes? - Stack Overflow
I am having trouble understanding the Initialization of classes. What's the point of them and how do we know what to include in them? Does writing in classes require a different type of thinking v...
What does __init__ and self do in python?
What does __init__ and self do in Python? __init__ is used to initialise the created class instance, in practice this mostly means setting the attributes the methods expect it to have. self refers to the current instance, although the name itself isn't special in any way whatsoever - you could use whatever valid identifier you wanted, although I don't particularly recommend deviating from established practices here because we're used to self. As for why your code doesn't do what you think, you never called that method. Random_Player = Game('Male', 19) Random_Player.score() As a side note I recommend reading PEP-8, PEP-257, and PEP-484 as the official style guide. More on reddit.com
Understanding classes, init and self
Could you explain this code excerpt? I am learning and trying to get in touch with the logic of classes. class NewWindow(tk.Toplevel): def __init__(self): super().__init__() self.title("Another window") More on discuss.python.org
05:13
init and super Method with Inheritance in Python | 48 - YouTube
03:10
What is the __init__ method in Python? - YouTube
08:06
How to Create a Class in Python and the __init__ Method - Python ...
06:48
Python __init__ Constructors For Beginners - Object Class ...
Class __init__ method - Python for Beginners
18:52
Python Class Constructors and Instance Initialization - YouTube
GeeksforGeeks
geeksforgeeks.org › python › __init__-in-python
__init__ in Python - GeeksforGeeks
DSA Python · Data Science · NumPy · Pandas · Practice · Django · Flask · Last Updated : 11 May, 2026 · __init__() method is a constructor which is automatically called when a new object of a class is created.
Published: May 11, 2026
Reddit
reddit.com › r/learnpython › what does __init__ and self do in python?
What does __init__ and self do in python? : r/learnpython
January 19, 2024 - The Book class example is just to show how Python classes work. The __init__ method is used for initializing an object's initial state, and self refers to the specific instance of the object, allowing each instance to have its own data.
Mimo
mimo.org › glossary › python › init-function
Python __init__() Function: Syntax, Usage, and Examples
The Python __init__() function serves as the constructor method for classes. It initializes newly created objects and allows you to assign values to object properties or run startup procedures when an instance is created.
Udacity
udacity.com › blog › __init__-in-python-an-overview
__init__ in Python: An Overview | Udacity
June 10, 2026 - The __init__ method lets the class initialize the object’s attributes. It assigns them their first values. It does not create the object itself. ... When you write UserAccount("sam", "sam@example.com"), Python creates the object, then calls __init__ to store "sam" and "sam@example.com" as attributes on that specific instance.
Pynerds
pynerds.com › python-classes-init-method
Python classes __init__() method
Welcome to GeorginaRamos's Video Chat! Here You can watch the Performer's free, live camera feed · scroll down · © 2026 livejasmin.com - All Rights Reserved! | Enter ONLY if you are at least 18 years old and agree to our cookie rules
W3Schools
w3schools.com › python › gloss_python_class_init.asp
Python __init__() Function
Note: The __init__() method is called automatically every time the class is being used to create a new object. Python Syntax Tutorial Class Create Class Object Methods self Modify Object Properties Delete Object Properties Delete Object Class pass Statement
iBiblio
ibiblio.org › g2swap › byteofpython › read › class-init.html
The __init__ method
The __init__ method is run as soon as an object of a class is instantiated. The method is useful to do any initialization you want to do with your object. Notice the double underscore both in the beginning and at the end in the name. ... #!/usr/bin/python # Filename: class_init.py class Person: ...
Real Python
realpython.com › python-init-py
What Is Python's __init__.py For? – Real Python
July 9, 2025 - Python’s special init.py file marks a directory as a regular Python package and allows you to import its modules. This file runs automatically the first time you import its containing package. You can use it to initialize package-level variables, define functions or classes, and structure the package’s namespace clearly for users.
Scaler
scaler.com › home › topics › __init__ in python
__init__ in Python - Scaler Topics
December 1, 2023 - In an object-oriented approach, the __init__ method is the Python equivalent of the C++ constructor. Every time an object is created from a class, the __init__function is called. The __init__ method only allows the class to initialize the object's attributes.
Instagram
instagram.com › popular › python-class-init
Python Class Init
April 17, 2026 - Welcome back to Instagram. Sign in to see what your friends, family and interests have been capturing and sharing around the world.