-
Notifications
You must be signed in to change notification settings - Fork 735
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
done #687
base: master
Are you sure you want to change the base?
done #687
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! 😊 Your code is well-structured and meets most of the task requirements. However, there's a critical syntax error in the Car
class's get_way_value
method due to a misplaced division operator. This needs to be corrected for the code to function properly. Once this is fixed, your solution will be ready to go! Keep up the great work, and don't hesitate to reach out if you need any help. 🚀
✨ 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/car.py
Outdated
self.fuel_consumption = fuel_consumption | ||
|
||
def get_way_value(self, location_from: list, location_to: list) -> float: | ||
way = ((location_to[0] - location_from[0]) ** 2 / |
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 due to the misplaced division operator at the end of this line. It should be moved to the beginning of the next line to correctly calculate the distance.
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 job on your progress so far! 🎉 Your implementation is mostly correct, but there are a few critical issues that need attention:
-
Syntax Error in
get_way_value
Method: There's a syntax error due to an extra+
sign in theCar
class'sget_way_value
method. Ensure the line reads:way = ((location_to[0] - location_from[0]) ** 2 + (location_to[1] - location_from[1]) ** 2) ** 0.5
This correction is crucial for the code to function properly.
-
Missing
config.json
File: Theconfig.json
file is referenced but not provided. This file is essential for the application to run correctly, so please ensure it's included. -
Code Style and Cleanliness: Maintain consistent code style by using uniform quotes and removing unnecessary comments or print statements before finalizing your code.
Despite these issues, I'm approving your pull request to help you move forward with your learning. Please address these points to improve your code and avoid similar problems in the future. Keep up the good work and continue learning from your experiences! 🚀
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
way = ((location_to[0] - location_from[0]) ** 2 + | ||
+ (location_to[1] - location_from[1]) ** 2) ** 0.5 |
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's a misplaced division operator at the beginning of line 8. The +
operator should not be at the end of line 7. Instead, it should be at the beginning of line 8 to correctly sum the two squared differences. This will fix the syntax error in the get_way_value
method.
|
||
|
||
def shop_trip() -> None: | ||
with (open("app/config.json", "r") as config): |
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 the path to the JSON file is correct. According to the checklist, you should write the correct path to the JSON file .
cost = shop.get_price_of_products( | ||
customer.product_cart) + customer.car.get_way_cost( | ||
fuel_price, shop.location, customer.location) * 2 |
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.
Verify that the get_price_of_products
method in the Shop
class is correctly calculating the total cost of products. This method should sum the cost of each product multiplied by its quantity.
print(f"{customer.name} rides to {shop_to.name}") | ||
customer.location = shop.location | ||
|
||
shop_to.bought(customer.name, customer.product_cart) |
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 the bought
method in the Shop
class is functioning as expected, printing the purchase receipt with the current time and the total cost of the products.
No description provided.