Foundations-of-Applied-Mathematics / Labs

Labs for the Foundations of Applied Mathematics curriculum.
https://foundations-of-applied-mathematics.github.io/
211 stars 71 forks source link

ObjectOriented - solutions file #15

Closed cnoorda2 closed 2 years ago

cnoorda2 commented 2 years ago

For the string magic method of ComplexNumber there's a "# Or, more likely," after the return statement with a way that students would probably code it. For the case where the complex part is negative it returns sign + str(self.imag) but a negative number cast as a string already has a negative sign. So this would print two negative signs.