-
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 #1742
base: master
Are you sure you want to change the base?
solution #1742
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.
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
average_rating: float, | ||
count_of_ratings: float) -> None: |
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 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
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) |
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.
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.
No description provided.