Sapphire - Sophia Tran#71
Conversation
tildeee
left a comment
There was a problem hiding this comment.
Great work on this project, Sophia! This project is marked as a "green" on my end.
Overall, your code looks great, and your solutions look like what I was looking for. Your code is readable and efficient. Your code demonstrates good understanding of OOP, instance methods, and inheritance. I wish I had more specific feedback for you, but genuinely, you hit all of the requirements and your approaches are good... I don't have much to say besides keep doing what you're doing!
In addition, your git hygiene looks great! Also, your test implementations look good too.
On a small note, in your project submission, on my end it looks like the tests for waves 2, 4, and 5 are still skipped.
That being said, great work. Please let me know what questions come up, and keep up the good job.
| self.remove(my_item) | ||
| other_vendor.add(my_item) | ||
|
|
||
| other_vendor.remove(their_item) | ||
| self.add(their_item) |
| if not self.inventory or not other_vendor.inventory: | ||
| return False | ||
|
|
||
| self.swap_items(other_vendor, self.inventory[0], other_vendor.inventory[0]) |
| best_item = None | ||
| condition = 0 | ||
|
|
||
| for item in self.inventory: | ||
| if item.get_category() == category and item.condition > condition: | ||
| condition = item.condition | ||
| best_item = item | ||
| return best_item |
There was a problem hiding this comment.
Your solution works, and it's a good solution especially since it only loops through inventory once! Optionally, there's a way to refactor this so it uses the get_by_category function and then calls max, if you wanted to practice that approach.
| 2: "Meh", | ||
| 3: "Okay", | ||
| 4: "Pretty good", | ||
| 5: "Brilliant, incredible, amazing, show stopping, spectacular, never the same, totally unique, completely not ever been done before" |
No description provided.