-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 #853
Solution #853
Conversation
app/main.py
Outdated
person_list = [] | ||
|
||
for index, person in enumerate(people): | ||
person_list.append(Person(name=person["name"], age=person["age"])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use list comprehension here
app/main.py
Outdated
if "wife" in person and person["wife"] is not None: | ||
person_list[index].wife = Person.people[person["wife"]] | ||
elif "husband" in person and person["husband"] is not None: | ||
person_list[index].husband = Person.people[person["husband"]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if "wife" in person and person["wife"] is not None: | |
person_list[index].wife = Person.people[person["wife"]] | |
elif "husband" in person and person["husband"] is not None: | |
person_list[index].husband = Person.people[person["husband"]] | |
if person.get("wife"): | |
person_list[index].wife = Person.people[person["wife"]] | |
elif person.get("husband"): | |
person_list[index].husband = Person.people[person["husband"]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job
No description provided.