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 #1810

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

Solution #1810

wants to merge 5 commits into from

Conversation

EjikVSeti
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! 😊 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.

app/main.py Show resolved Hide resolved
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.

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
Comment on lines 35 to 36
except ZeroDivisionError:
return 0

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.

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