Skip to content

Commit

Permalink
Delete commented code
Browse files Browse the repository at this point in the history
  • Loading branch information
Liliya committed Oct 27, 2023
1 parent d74ac53 commit 73da1b7
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ def __init__(self, name: str, age: int) -> None:


def create_person_list(people: list) -> list:
result_list = []
for person in people:
inst = Person(name=person["name"], age=person["age"])
result_list.append(inst)
result_list = [Person(name=person["name"], age=person["age"])
for person in people]
for index, person in enumerate(people):
if "wife" in person and person["wife"] is not None:
if person.get("wife") is not None:
result_list[index].wife = Person.people[person["wife"]]
elif "husband" in person and person["husband"] is not None:
elif person.get("husband") is not None:
result_list[index].husband = Person.people[person["husband"]]
return result_list

0 comments on commit 73da1b7

Please sign in to comment.