What is the meaning of 'self' and '__init__' expressions in Python? [closed]
I don't understand what these are used for, particularly the self argument? Could some please explain this to me and why on earth you would want to pass this in? Also, I've always thought __init__ was for 'initialisation', but it didn't occur to me that I've never had to put anything in here before. Could someone give me an easy example? edit: i just get so confused everytime i see self being passed into a function, or something of the like. self is the object you're calling the method on. It's a bit like this in Java. __init__ is called on each object when it is created to initialise it. It's