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

  • (A) __add__()
  • (B) __plus__()
  • (C) __sum__()
  • (D) __combine__()
πŸ’¬ Discuss
βœ… Correct Answer: (A) __add__()
Explanation: __add__() is used to override the + operator in a class.
Explanation by: Mr. Dubey
__add__() is used to override the + operator in a class.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
80
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
91%
Success Rate