Conversation
| super().__init__("Decor", condition) | ||
|
|
||
| def __str__(self): | ||
| return (f"Something to decorate your space.") No newline at end of file |
There was a problem hiding this comment.
you don't have to use a f string because you are just returning the string
return "Something to decorate your space"
tgoslee
left a comment
There was a problem hiding this comment.
Great job Theresa ! I left some comments on your project on things you did well and suggestions for refactoring. Let me know if you have any questions.
|
|
||
|
|
||
| def __str__(self): | ||
| return (f"A gadget full of buttons and secrets.") |
There was a problem hiding this comment.
| return (f"A gadget full of buttons and secrets.") | |
| return "A gadget full of buttons and secrets." |
| super().__init__("Clothing", condition) | ||
|
|
||
| def __str__(self): | ||
| return (f"The finest clothing you could wear.") No newline at end of file |
There was a problem hiding this comment.
| return (f"The finest clothing you could wear.") | |
| return "The finest clothing you could wear." |
| def __str__(self): | ||
| return f"Hello World!" | ||
|
|
||
| def condition_description(self): |
There was a problem hiding this comment.
Good job making an if/elif statement here. I would look into how you could possibly improve this block of code by using other data structures.
| book_1 = Item(category="books") | ||
| coat_1 = Item(category="clothing") | ||
| hat_1 = Item(category="clothing") No newline at end of file |
There was a problem hiding this comment.
remove test code/debugging code when you are finished and before submitting final code.
| self.inventory.append(their_item) | ||
| self.inventory.remove(my_item) | ||
| vendor.inventory.append(my_item) | ||
| vendor.inventory.remove(their_item) |
There was a problem hiding this comment.
you can use the instance methods you already created so self.add(their_item) and self.remove(my_item)
| else: | ||
| return False | ||
|
|
||
| def swap_first_item(self,vendor): |
There was a problem hiding this comment.
how could you use swap_items() here to reduce redundant code?
| def swap_best_by_category(self, other, my_priority, their_priority): | ||
| my_best = self.get_best_by_category(their_priority) | ||
| if my_best == None: | ||
| return False | ||
| their_best = other.get_best_by_category(my_priority) | ||
| if their_best == None: | ||
| return False | ||
| return self.swap_items(other, my_best, their_best) |
There was a problem hiding this comment.
Here is a suggestion for cleaning up your code slightly.
| def swap_best_by_category(self, other, my_priority, their_priority): | |
| my_best = self.get_best_by_category(their_priority) | |
| if my_best == None: | |
| return False | |
| their_best = other.get_best_by_category(my_priority) | |
| if their_best == None: | |
| return False | |
| return self.swap_items(other, my_best, their_best) | |
| def swap_best_by_category(self, other, my_priority, their_priority): | |
| my_best = self.get_best_by_category(their_priority) | |
| their_best = other.get_best_by_category(my_priority) | |
| if not my_best or not their_best: | |
| return False | |
| return self.swap_items(other, my_best, their_best) |
No description provided.