Sea Turtles - Shannon B. - swap meet#102
Open
eggoweggo wants to merge 2 commits intoada-c17:masterfrom
Open
Conversation
tgoslee
reviewed
Apr 17, 2022
tgoslee
left a comment
There was a problem hiding this comment.
Great job Shannon. I left some comments on what you did well and a few suggestions. Let me know if you have any questions.
| pass No newline at end of file | ||
| from swap_meet.item import Item | ||
|
|
||
| class Clothing(Item): |
| pass No newline at end of file | ||
| from swap_meet.item import Item | ||
|
|
||
| class Decor(Item): |
| pass | ||
| from swap_meet.item import Item | ||
|
|
||
| class Electronics(Item): |
| def __str__(self): | ||
| return "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.
Comment on lines
+5
to
+8
| if inventory is None: | ||
| self.inventory = [] | ||
| else: | ||
| self.inventory = inventory |
There was a problem hiding this comment.
another fun to do it self.inventory = inventory if inventory is not None else []
Comment on lines
+30
to
+33
| friend.add(my_item) | ||
| self.remove(my_item) | ||
| self.add(their_item) | ||
| friend.remove(their_item) |
There was a problem hiding this comment.
great use of the instance methods you created.
| else: | ||
| return False | ||
|
|
||
| def swap_first_item(self, friend): |
There was a problem hiding this comment.
great job here. You could also use try/except in a few places instead of if/else for your error handling.
| self.swap_items(friend, self.inventory[0], friend.inventory[0]) | ||
| return True | ||
|
|
||
| def get_best_by_category(self, category=""): |
| best_item = item | ||
| return best_item | ||
|
|
||
| def swap_best_by_category(self, other, my_priority, their_priority): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.