Answer:
Implement a class MyInt() that behaves almost the same as the class int, except when trying to add an object of type MyInt. Then, this strange behavior occurs.
>>> x = myInt(5)
>>> x * 4
20
>>> x * (4 + 6)
50
>>> x + 6
11
4.6m questions
5.9m answers