-
selfmeans that no other arguments are required to be passed into the method. - There is no real purpose for the
selfmethod; it’s just historic computer science jargon that Python keeps to stay consistent with other programming languages. -
selfrefers to the instance whose method was called. -
selfrefers to the class that was inherited from to create the object usingself.
Correct Answer:
-
selfrefers to the instance whose method was called.
Simple example
class my_secrets:
def __init__(self, password):
self.password = password
pass
instance = my_secrets('1234')
instance.password
>>>'1234'