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

implement py-person-class #1667

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

Conversation

AlexCyberf
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 Person class and the create_person_list function! 🎉 Your code meets the task requirements and constraints effectively. While there are some potential areas for improvement, such as ensuring the existence of keys in dictionaries to prevent KeyError, these are minor and do not impact the overall functionality. Keep up the good work, and consider these suggestions for future enhancements! 😊

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

Comment on lines +11 to +12
result_list = [Person(name=person["name"], age=person["age"])
for person in people]

Choose a reason for hiding this comment

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

The list comprehension correctly creates Person instances, but ensure that the input list people contains dictionaries with the keys name and age to avoid KeyError.

Comment on lines +16 to +17
main_person = Person.people[person["name"]]
wife_person = Person.people[person["wife"]]

Choose a reason for hiding this comment

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

Before accessing Person.people[person['wife']], ensure that the wife exists in the people dictionary to avoid a potential KeyError.

Comment on lines +20 to +21
main_person = Person.people[person["name"]]
husband_person = Person.people[person["husband"]]

Choose a reason for hiding this comment

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

Similarly, before accessing Person.people[person['husband']], ensure that the husband exists in the people dictionary to avoid a potential KeyError.

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