Question

What is the purpose of the "self" parameter in a Python class method?

A It refers to the current instance of the class. Correct Answer Incorrect Answer
B It is a keyword used to indicate the end of a method. Correct Answer Incorrect Answer
C It is used to define a static method. Correct Answer Incorrect Answer
D It is required for all methods in a class. Correct Answer Incorrect Answer

Solution

It refers to the current instance of the class.

Practice Next

Relevant for Exams:

×
×