Let A and B be objects of class Foo. Which functions are called when print(A + B) is executed?

Let A and B be objects of class Foo. Which functions are called when print(A + B) is executed? Correct Answer __add__(), __str__()

The function __add__() is called first since it is within the bracket. The function __str__() is then called on the object that we received after adding A and B.

Related Questions

What will be the output of the following code?
Abstract class A has 4 virtual functions. Abstract class B defines only 2 of those member functions as it extends class A. Class C extends class B and implements the other two member functions of class A. Choose the correct option below.
Which of the following Python code will print True?
a = foo(2)b = foo(3)print(a