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

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

solution #1742

wants to merge 3 commits into from

Conversation

yuliiayedynak
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.

Great job on implementing the Car and CarWashStation classes! 🎉 Your code meets the task requirements and constraints, and the methods are implemented as described. Just a couple of minor suggestions: consider adding validation to ensure the rating parameter is within a valid range (e.g., 1 to 5) to maintain accurate average ratings, and ensure count_of_ratings is an integer since it represents a count. Keep up the good work and happy coding! 😊

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

app/main.py Outdated
Comment on lines 15 to 16
average_rating: float,
count_of_ratings: float) -> None:

Choose a reason for hiding this comment

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

The count_of_ratings parameter should be of type int instead of float, as it represents a count of ratings, which is inherently an integer value.

app/main.py Outdated
Comment on lines 39 to 43
def rate_service(self, rating: int) -> None:
sum_of_ratings = self.average_rating * self.count_of_ratings + rating
self.count_of_ratings += 1
self.average_rating = round(sum_of_ratings
/ self.count_of_ratings, 1)

Choose a reason for hiding this comment

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

Consider adding validation to ensure that the rating parameter is within a valid range (e.g., 1 to 5). This will prevent invalid ratings from affecting the average rating calculation.

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