Which special method enables the + operator for a class in Python?
-
A
__plus__
-
B
__sum__
-
C
__concat__
-
D
__add__
Correct answer
Correct answer
D. __add__
5 views
Explanation
__add__ implements addition.
Doubts & discussion
Not sure why the answer is D? Ask here and get an explanation.
Ask a doubt about this MCQ