-
Notifications
You must be signed in to change notification settings - Fork 701
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
solution #661
base: master
Are you sure you want to change the base?
solution #661
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.
Thank you for your hard work on this project! 😊 There are a few critical issues that need to be addressed before we can approve the pull request. Firstly, there's a syntax error in the import statement for the dataclass
, which needs to be corrected to ensure the code runs properly. Additionally, the customer's location should be updated to the shop's location when they make a purchase, as per the task requirements. Lastly, there's a typo in the variable name product_coast
which should be corrected to product_cost
. Please make these changes, and feel free to reach out if you need any help! Keep up the great work! 🚀
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
🔄 Fix the issues, commit the changes, and then re-request my review using the Re-request review
button in the Reviewers tab.
@@ -0,0 +1,7 @@ | |||
from dataclasses import dataclass |
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.
There is a syntax error here. The import statement should be from dataclasses import dataclass
without the slash (/
).
app/customer.py
Outdated
|
||
def calculate_products_cost(self, shop: Shop, | ||
print_info: bool = False) -> float: | ||
product_coast = sum([shop.products[key] * self.product_cart[key] |
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.
The variable product_coast
seems to be a typo. It should be product_cost
to reflect its purpose of storing the total cost of products.
|
||
selected_shop_name = min(shops_trip, key=shops_trip.get) | ||
selected_shop_expenses = shops_trip[selected_shop_name] | ||
if self.money >= shops_trip[selected_shop_name]: |
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.
Ensure that when the customer decides to make a purchase, their location is updated to the shop's location as required by the task description.
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.
Review Summary
Great job on your submission! 🎉 Your code is well-structured and mostly aligns with the task requirements. However, there are a few critical areas that need your attention to ensure full functionality:
-
Syntax Error in Import Statement: In
app/car.py
, there's a syntax error in the import statement fordataclass
. Please correct it tofrom dataclasses import dataclass
to ensure the code runs properly. -
Customer Location Update: It's crucial to update the customer's location to the shop's location after a purchase. This is a key requirement that hasn't been implemented yet. Consider adding
self.location = selected_shop_instance.location
after the purchase to meet this requirement. -
Variable Name Typo: In
app/customer.py
, there's a typo in the variable nameproduct_cost
. Make sure to correct this to avoid any potential issues. -
Configuration File: Ensure that the
config.json
file contains all necessary fields and data structures expected byapp/main.py
.
Your efforts are commendable, and addressing these points will enhance the functionality of your code. Remember, learning from these adjustments is a valuable part of your development journey. Keep up the great work, and don't hesitate to reach out if you need further assistance! 🚀
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
@@ -0,0 +1,7 @@ | |||
from dataclasses import dataclass |
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.
There is a syntax error in the import statement. It should be from dataclasses import dataclass
without the slash.
for shop in shops: | ||
if shop.name == selected_shop_name: | ||
selected_shop_instance = shop | ||
self.calculate_products_cost(selected_shop_instance, print_info=True) |
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.
After the customer makes a purchase, their location should be updated to the shop's location as per the task requirements. Consider adding self.location = selected_shop_instance.location
after the purchase.
No description provided.