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