Update page 'Day 3 homework - Sloetjes'

xuanyi.wang
2023-04-03 20:59:14 +02:00
parent 56dee7d0b1
commit 48170c378b
+1 -1
@@ -117,7 +117,7 @@ class BoundedInt():
return BoundedInt(result, self.min, self.max) return BoundedInt(result, self.min, self.max)
``` ```
**7. You don't have to implement the code, but think about how you would change the template so it could allow adding a BoundedInt to an emoji, if there was a hypothetical function sentiment(emoji) which returned a floating point number from -10.0 to 10.0 which indicated whether the emoji was happy or sad. e.g. BoundedInt(1, min = 1, max = 10) + 😁 would raise `ValueError`.** **7. You don't have to implement the code, but think about how you would change the template so it could allow adding a BoundedInt to an emoji, if there was a hypothetical function `sentiment(emoji)` which returned a floating point number from -10.0 to 10.0 which indicated whether the emoji was happy or sad. e.g. BoundedInt(1, min = 1, max = 10) + 😁 would raise `ValueError`.**
``` ```
class BoundedInt(): class BoundedInt():