3.2.3
question:Return to the first representation of the Rectangle class example of Section 3.2.3 and write a validity method that ensures that the value placed in the area slot is indeed the product of the width and the height.
3.2.3
question:Return to the first representation of the Rectangle class example of Section 3.2.3 and write a validity method that ensures that the value placed in the area slot is indeed the product of the width and the height.
def validity(self):
if self.area != self.width * self.height:
return False
else:
return True