-
Notifications
You must be signed in to change notification settings - Fork 590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C17-Sharks-Raha #15
base: main
Are you sure you want to change the base?
C17-Sharks-Raha #15
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Raha!
Your submission has completed all waves and passed all required tests. Your code was easy to read and utilized a lot of helper functions which made your code very neat! I also appreciated your docstrings too 😄
I have added comments to your project on ways to refactor, follow pep8 guidelines, and provided alternative approaches to the waves.
Overall, this project is well-deserving of a 🟢 green 🟢 ✨
Keep up the great work Raha!
super().__init__(category = "Clothing", condition = condition, age = age) | ||
|
||
def __str__(self): | ||
return "The finest clothing you could wear." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Good work in ensuring that all Clothing
instances have a category
of "Clothing"
by passing the category value into the parent constructor.
super().__init__(category = "Decor", condition = condition, age = age) | ||
|
||
def __str__(self): | ||
return "Something to decorate your space." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
def __init__(self, condition = 0, age = 0): | ||
super().__init__(category = "Electronics", condition = condition, age = age) | ||
|
||
def __str__(self): | ||
return "A gadget full of buttons and secrets." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
self.category = category | ||
self.condition = condition | ||
self.age = age | ||
def __str__(self): | ||
|
||
return f"Hello World!" | ||
|
||
def condition_description(self): | ||
if 0 <= self.condition < 1: | ||
return "Just trash it!" | ||
elif 1 <= self.condition < 2: | ||
return "Enjoy the last moments!" | ||
elif 2 <= self.condition < 3: | ||
return "As good as 30 year old wine!" | ||
elif 3 <= self.condition < 4: | ||
return "Better than the new one" | ||
elif 4 <= self.condition <= 5: | ||
return "No need to ask!" | ||
else: | ||
return False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Great work! One minor suggestion:
- Use 1 line of whitespace to separate function definitions from other logic. So in this case, you should have a space above
def __str__(self):
.
inventory = [] | ||
self.inventory = inventory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work! We can also use a ternary to assign the value of self.inventory
:
self.inventory = inventory if inventory else []
assert result | ||
assert len(tai.inventory) == 3 | ||
assert len(jesse.inventory) == 3 | ||
assert item_a in tai.inventory | ||
assert item_b in tai.inventory | ||
assert item_c not in tai.inventory | ||
assert item_f in tai.inventory | ||
assert item_c not in tai.inventory | ||
assert item_d in jesse.inventory | ||
assert item_e in jesse.inventory | ||
assert item_f not in jesse.inventory | ||
assert item_c in jesse.inventory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
assert result | ||
assert len(tai.inventory) == 3 | ||
assert len(jesse.inventory) == 3 | ||
assert item_a in tai.inventory | ||
assert item_b in tai.inventory | ||
assert item_f in tai.inventory | ||
assert item_c not in tai.inventory | ||
assert item_d in jesse.inventory | ||
assert item_e in jesse.inventory | ||
assert item_f not in jesse.inventory | ||
assert item_c in jesse.inventory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
assert result == False | ||
assert len(tai.inventory) == 3 | ||
assert len(jesse.inventory) == 3 | ||
assert item_a in tai.inventory | ||
assert item_b in tai.inventory | ||
assert item_c in tai.inventory | ||
assert item_d not in tai.inventory | ||
assert item_e not in tai.inventory | ||
assert item_f not in tai.inventory | ||
assert item_d in jesse.inventory | ||
assert item_e in jesse.inventory | ||
assert item_f in jesse.inventory | ||
assert item_a not in jesse.inventory | ||
assert item_b not in jesse.inventory | ||
assert item_c not in jesse.inventory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
assert result == False | ||
assert len(tai.inventory) == 3 | ||
assert len(jesse.inventory) == 3 | ||
assert item_a in tai.inventory | ||
assert item_b in tai.inventory | ||
assert item_c in tai.inventory | ||
assert item_d not in tai.inventory | ||
assert item_e not in tai.inventory | ||
assert item_f not in tai.inventory | ||
assert item_d in jesse.inventory | ||
assert item_e in jesse.inventory | ||
assert item_f in jesse.inventory | ||
assert item_a not in jesse.inventory | ||
assert item_b not in jesse.inventory | ||
assert item_c not in jesse.inventory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
def condition_description(self): | ||
if 0 <= self.condition < 1: | ||
return "Just trash it!" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love this description 😆🗑️
No description provided.