diff --git a/app/main.py b/app/main.py index f6bcaa1dd..a17740f87 100644 --- a/app/main.py +++ b/app/main.py @@ -1,8 +1,21 @@ class Person: - # write your code here - pass + people = {} + + def __init__(self, name: str, age: int) -> None: + self.name = name + self.age = age + self.people[name] = self def create_person_list(people: list) -> list: - # write your code here - pass + for human in people: + Person(human["name"], human["age"]) + + for human in people: + if human.get("wife"): + Person.people[human["name"]].wife = Person.people[human["wife"]] + if human.get("husband"): + Person.people[human["name"]].husband \ + = Person.people[human["husband"]] + + return list(Person.people.values())