PCPP1 • Practice Test 13
Free PCPP1 practice test — 15 questions with explanations. Set 13. No signup required.
You are implementing a class that represents a monetary amount. You want the expression amount1 + amount2 to return a new Money instance, and you also want amount1 + 5 to work by treating 5 as a Money with zero cents. However, 5 + amount1 should raise a TypeError. Which implementation achieves this behavior?
Choose an answer to begin — your selection is scored in the full session.
15 questions · instant feedback and full explanations after every question.