-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 #1610
base: master
Are you sure you want to change the base?
Solution #1610
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 effectively. While there are minor improvements suggested, such as simplifying the average rating calculation and renaming a variable for clarity, these do not impact the core functionality. Keep up the good work and consider these suggestions for even cleaner code in the future! 😊
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
app/main.py
Outdated
for car in cars: | ||
if car.clean_mark < self.clean_power: | ||
wash_price = self.calculate_washing_price(car) | ||
total_cars += wash_price |
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 variable total_cars
is intended to accumulate the total washing price, but the name is misleading. Consider renaming it to total_price
or total_revenue
for clarity.
self.average_rating = round((self.average_rating | ||
* self.count_of_ratings + new_rate) | ||
/ (self.count_of_ratings + 1), 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.
The calculation for the new average rating is correct, but it could be simplified for better readability. Consider breaking it down into smaller steps or using descriptive variable names for intermediate calculations.
No description provided.