+ 1
How do __init__ work?
Could you give me either the answer or a link to it?
6 ответов
+ 4
Thanks Tibor Santa ! these look good! Ive completed 2 basic python courses snd still have difficulty with OOP
+ 3
You can find loads of python oop tutorials online that explain this in detail...
https://python.swaroopch.com/oop.html
I particularly liked this one because it starts from the very minimum and concludes at the subtle differences between static methods, class methods and instance methods:
https://www.python-course.eu/python3_object_oriented_programming.php
+ 2
The __init__ function in python is the constructor of a class, it is called when you instantiate the object.
https://www.sololearn.com/learn/Python/2468/
0
Tibor Santa Ok but I meant, how does it work *inside*?
0
SpaceNerd maybe it created lots of attributes (2nd argument, 3rd etc) for the first one that you can easier to assign through argument of class and call it out by type ".namemethod"
0
SpaceNerd it's a special method for class