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

Ready solutions for all tasks #1638

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

Conversation

Ngayka
Copy link

@Ngayka Ngayka commented Dec 18, 2024

All methods are working, added "other" type cheking

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 Distance class with all the required magic methods! 🎉 The code meets the task requirements and constraints, and you've done well to follow the checklist guidelines. While there are a couple of minor issues, such as the redundant return statement in the __le__ method and the missing return statement in the __ge__ method, these do not significantly impact the functionality. Keep up the good work, and consider refining these areas for even cleaner code in the future! 😊

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

return self.km <= other
elif isinstance(other, Distance): # Якщо other — об'єкт Distance
return self.km <= other.km
return self.km <= other.km

Choose a reason for hiding this comment

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

The return statement here is redundant because it repeats the logic already covered in the previous conditions. Consider removing this line.

if isinstance(other, (int, float)): # Якщо other — число
return self.km >= other
elif isinstance(other, Distance): # Якщо other — об'єкт Distance
return self.km >= other.km

Choose a reason for hiding this comment

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

The __ge__ method lacks a return statement for the comparison. Ensure that the method returns a boolean value for all cases.

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