The self parameter means a reference to the class itself, it is used to access variables that belongs to the class.
Example
class Person: def __init__(mysillyobject, name, age):
mysillyobject.name = name
mysillyobject.age = age
def myfunc(mindstick): print("Hello my name is " + mindstick.com)
p1 = Person("prakash", 19)
p1.myfunc()
Join MindStick Community
You need to log in or register to vote on answers or questions.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
The self Parameter :
The self parameter means a reference to the class itself, it is used to access variables that belongs to the class.
Example