-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 #1810
base: master
Are you sure you want to change the base?
Solution #1810
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 implementation of the Car
and CarWashStation
classes is mostly correct, and you've done a great job meeting the task requirements. However, there's a critical issue that needs to be addressed before we can approve the pull request. The calculate_washing_price
method could potentially cause a division by zero error if distance_from_city_center
is zero. This would lead to a runtime error, so it's important to add a check to handle this scenario. Once this issue is resolved, your code will be in great shape! Keep up the good 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.
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 implementing the Car
and CarWashStation
classes! 🚗🧼 Your solution meets the task requirements, and you've done well to address potential division by zero errors in the calculate_washing_price
method using a try-except block. However, returning 0 in such cases might lead to unexpected results in income calculations. Consider logging a warning or adjusting the logic to handle this scenario more informatively in the future.
Your code adheres to clean code practices with descriptive variable names and appropriate error handling. While the current implementation is correct, addressing the division by zero issue more effectively will enhance the robustness of your solution.
Keep up the good work, and use this feedback to refine your skills further. Remember, learning from these experiences is key to becoming a better developer! 🌟
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
app/main.py
Outdated
except ZeroDivisionError: | ||
return 0 |
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 current handling of the ZeroDivisionError by returning 0 might not be the most appropriate solution, as it could lead to unexpected results in the overall income calculation. Consider logging a warning or adjusting the logic to handle this scenario more informatively.
This reverts commit 838a44c.
No description provided.