Update page 'Day 3 homework - Sloetjes'

xuanyi.wang
2023-04-03 20:25:02 +02:00
parent f98ee522d9
commit 031c14ccb6
+2 -2
@@ -91,7 +91,7 @@ class BoundedInt:
return str(self.i) return str(self.i)
``` ```
**8. Modify the template so it also supports adding a regular integer to a BoundedInt, to pass test 4. Note that you can use isinstance() to determine the class of a variable.** **8. Modify the template so it also supports adding a regular integer to a BoundedInt, to pass test 4. Note that you can use `isinstance()` to determine the class of a variable.**
``` ```
class BoundedInt(): class BoundedInt():
def __init__(self, i, min, max): def __init__(self, i, min, max):
@@ -170,7 +170,7 @@ class BoundedInt():
raise ValueError("Result exceeds min value") raise ValueError("Result exceeds min value")
return BoundedInt(result, self.min, self.max) return BoundedInt(result, self.min, self.max)
``` ```
#####An example of `sentiment(emoji)`: ##### An example of `sentiment(emoji)`:
``` ```
def sentiment(emoji): def sentiment(emoji):
sentiment_scores = { sentiment_scores = {