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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Solution #1753

wants to merge 1 commit into from

Conversation

Hlibynka
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 perform as expected. There are a couple of minor improvements you could consider for future projects:

  1. Rate Validation: It would be beneficial to add validation for the rate parameter in the rate_service method to ensure it falls within a valid range, such as 1 to 5. This will help maintain data integrity and prevent unexpected values.

  2. Simplify Code: The check if cars: in the serve_cars method is unnecessary since iterating over an empty list will naturally result in no iterations. Removing this check can simplify your code.

Keep up the great work, and keep these tips in mind for even cleaner and more robust code in the future! 😊

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


def serve_cars(self, cars: list) -> int:
income = 0
if cars:

Choose a reason for hiding this comment

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

The check if cars: is unnecessary because iterating over an empty list will naturally result in no iterations. You can remove this check to simplify the code.

income += self.wash_single_car(car)
return income

def rate_service(self, rate: int) -> None:

Choose a reason for hiding this comment

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

Consider adding validation for the rate parameter to ensure it is within an acceptable range (e.g., 1 to 5) before updating the average rating.

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