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