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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Solution #1590

wants to merge 3 commits into from

Conversation

Bulavka-d
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 create_person_list function! 🎉 Your code meets the task requirements and constraints effectively. While there are minor style recommendations, such as using dict.get() for safer dictionary access and list comprehensions for cleaner code, these do not impact the functionality. Keep up the good work and consider these suggestions for future improvements! 😊

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

app/main.py Outdated

person_list = []

for person_data in people:

Choose a reason for hiding this comment

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

Consider using list comprehension for creating the person_list to make the code more concise, as recommended in the checklist.

app/main.py Outdated

for person_data in people:
person = Person.people[person_data["name"]]
if "wife" in person_data and person_data["wife"]:

Choose a reason for hiding this comment

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

Use person_data.get('wife') instead of checking with in to simplify the code and avoid potential KeyError exceptions, as suggested in the checklist.

app/main.py Outdated
person = Person.people[person_data["name"]]
if "wife" in person_data and person_data["wife"]:
person.wife = Person.people[person_data["wife"]]
elif "husband" in person_data and person_data["husband"]:

Choose a reason for hiding this comment

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

Use person_data.get('husband') instead of checking with in to simplify the code and avoid potential KeyError exceptions, as suggested in the checklist.

Copy link

@petrykivd petrykivd left a comment

Choose a reason for hiding this comment

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

Take Buddy's advice and fix it.

@Bulavka-d Bulavka-d requested a review from petrykivd December 4, 2024 12:21
@Bulavka-d
Copy link
Author

I've made the changes.

Copy link

@petrykivd petrykivd left a comment

Choose a reason for hiding this comment

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

Good job! 🚀

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.

4 participants