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()
Liked By
Write Answer
The self Parameter :
Join MindStick Community
You have need login or register for voting of answers or question.
Prakash nidhi Verma
04-Jul-2018The self Parameter :
The self parameter means a reference to the class itself, it is used to access variables that belongs to the class.
Example