Update page 'Day 3 homework - Sloetjes'

xuanyi.wang
2023-04-03 20:16:18 +02:00
parent df82f75030
commit f98ee522d9
-6
@@ -60,12 +60,6 @@ class BoundedInt:
raise ValueError("Value exceeds maximum bound.") raise ValueError("Value exceeds maximum bound.")
return BoundedInt(result, self.min, self.max) return BoundedInt(result, self.min, self.max)
def __sub__(self, other):
result = self.i - other
if self.min is not None and result < self.min:
raise ValueError("Value exceeds minimum bound.")
return BoundedInt(result, self.min, self.max)
def __radd__(self, other): def __radd__(self, other):
return self.__add__(other) return self.__add__(other)