Skip to content
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 #668

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Solution #668

wants to merge 4 commits into from

Conversation

dimakherson74
Copy link

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a 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. The most pressing concerns are the syntax errors in the bought_milk, bought_bread, and bought_butter methods due to incorrect usage of quotes, and the typo in the method name prise_products, which should be price_products. Additionally, ensure that the customer_location and shop_location are validated as lists of integers in the cost_of_the_trip method. Once these issues are resolved, your code will be in great shape! 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.

app/customer.py Outdated
Comment on lines 41 to 44
def bought_milk(self, product_milk: float) -> None:
print(
f"{self.product_cart["milk"]} milks "
f"for {self.product_cart["milk"] * product_milk} dollars")

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 bought_milk method. The use of double quotes inside the f-string is incorrect. You should use single quotes around the keys in self.product_cart to avoid this issue.

app/customer.py Outdated
Comment on lines 46 to 49
def bought_bread(self, product_bread: float) -> None:
print(
f"{self.product_cart["bread"]} bread "
f"for {self.product_cart["bread"] * product_bread} dollars")

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 bought_bread method. The use of double quotes inside the f-string is incorrect. You should use single quotes around the keys in self.product_cart to avoid this issue.

app/customer.py Outdated
Comment on lines 51 to 53
def bought_butter(self, product_butter: float) -> None:
print(f"{self.product_cart["butter"]} butter "
f"for {self.product_cart["butter"] * product_butter} dollars")

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 bought_butter method. The use of double quotes inside the f-string is incorrect. You should use single quotes around the keys in self.product_cart to avoid this issue.

app/main.py Outdated
min_cost = (customer.cost_of_the_trip(
fuel_prize,
customer.location,
shop.location) * 2 + shop.prise_products(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method prise_products is likely a typo and should be price_products based on its functionality. Ensure that the method name matches the intended purpose.

app/shop.py Outdated
self.location = location
self.products = products

def prise_products(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method name prise_products seems to be a typo. It should be price_products to better reflect its purpose of calculating the total price of the specified products.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job on addressing the previous issues in your code! 🎉 Here’s a summary of the review:

  • Syntax Errors: You've successfully corrected the syntax errors in the bought_milk, bought_bread, and bought_butter methods. Well done!

  • Method Name Correction: The typo in the method name prise_products has been fixed to price_products.

  • Validation of Locations: The cost_of_the_trip method now correctly validates customer_location and shop_location as lists of integers, which is crucial for preventing runtime errors.

  • File Structure and Requirements: Your project structure meets the requirements, with the necessary modules and classes in place.

  • Consistency in String Quotes: Ensure consistent use of double quotes for strings throughout your code, as recommended by the checklist.

  • File Path: Double-check that the path to config.json is correct to ensure your application loads configuration data properly.

Your code now meets the task requirements and constraints. Keep up the good work, and make sure to review the comments to further improve your code. Addressing these points will help you avoid similar issues in the future and enhance your coding skills. Keep learning and growing! 🚀

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

Comment on lines +26 to +27
customer_location: list[int],
shop_location: list[int]) -> float:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that customer_location and shop_location are validated as lists of integers. This is important to prevent potential runtime errors if invalid data is passed to the method.

Comment on lines +43 to +44
f'{self.product_cart["milk"]} milks '
f'for {self.product_cart["milk"] * product_milk} dollars')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using double quotes for strings to maintain consistency throughout the code, as recommended by the checklist.

Comment on lines +48 to +49
f'{self.product_cart["bread"]} bread '
f'for {self.product_cart["bread"] * product_bread} dollars')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using double quotes for strings to maintain consistency throughout the code, as recommended by the checklist.

Comment on lines +52 to +53
print(f'{self.product_cart["butter"]} butter '
f'for {self.product_cart["butter"] * product_butter} dollars')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using double quotes for strings to maintain consistency throughout the code, as recommended by the checklist.

app/main.py Outdated


def shop_trip() -> None:
with open("config.json") as config:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that the path to config.json is correct. This is crucial for the application to load the configuration data properly.

Comment on lines +42 to +43
print(f"{customer.name}'s trip to "
f"the {shop.name} costs {min_cost}")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using double quotes for strings to maintain consistency throughout the code, as recommended by the checklist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants