πŸ“Š Problem Solving and Python Programming
Q. Let A and B be objects of class Foo. Which functions are called when print(A + B) is executed?
  • (A) add (), str ()
  • (B) str (), add ()
  • (C) sum (), str ()
  • (D) str (), sum ()
πŸ’¬ Discuss
βœ… Correct Answer: (A) add (), str ()

Explanation: 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.


Explanation by: Mr. Dubey
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.

πŸ’¬ Discussion

πŸ“Š Question Analytics

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