A

Admin • 833K Points
Coach

Q. Which method is used to override the default behavior of the + operator?

  • (A) __add__()
  • (B) __plus__()
  • (C) __sum__()
  • (D) __combine__()
  • Correct Answer - Option(A)
  • Views: 21
  • Filed under category Python
  • Hashtags:

Explanation by: Admin

__add__() is used to override the + operator in a class.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.