Update page 'Day 3 homework - Sloetjes'
@@ -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():
|
||||||
|
|||||||
Reference in New Issue
Block a user