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

implementing CarWashStation and Car classes #1919

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

Conversation

Maaax256
Copy link

No description provided.

@Anollinna
Copy link

God job! Everything looks clean.

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! 🎉 The code meets the task requirements and constraints, and the methods are implemented correctly. While there is a minor redundancy with the condition self.clean_power > car.clean_mark being checked twice, it doesn't affect the functionality. Keep up the good work, and consider refining the code to remove such redundancies in the future for cleaner and more efficient code. Well done! 😊

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

def serve_cars(self, cars: list[Car]) -> float:
income = 0.0
for car in cars:
if self.clean_power > car.clean_mark:

Choose a reason for hiding this comment

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

The condition self.clean_power > car.clean_mark is checked twice: once in serve_cars and again in wash_single_car. This redundancy can be avoided by assuming the condition is met before calling wash_single_car.

* self.average_rating / self.distance_from_city_center, 1)

def wash_single_car(self, car: Car) -> None:
if self.clean_power > car.clean_mark:

Choose a reason for hiding this comment

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

As mentioned earlier, the condition self.clean_power > car.clean_mark is redundant here since it is already checked in the serve_cars method before calling wash_single_car. Consider removing this condition.

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.

3 participants