Q. What will the following code print?
Code:
class A:
def __str__(self):
return "Hello"
obj = A()
print(obj)
β
Correct Answer: (A)
Hello
Explanation: `__str__` method is called when printing the object, so 'Hello' is printed.