Skip to content

Commit

Permalink
Done
Browse files Browse the repository at this point in the history
  • Loading branch information
Moonralex committed Oct 23, 2023
1 parent e075ff6 commit da4b8dd
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions app/main.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
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
result_list = []
for person_dict in people:
name = person_dict["name"]
Person(name, person_dict["age"])
result_list.append(Person.people[name])
for person_dict in people:
name = person_dict["name"]
if "wife" in person_dict and person_dict["wife"] is not None:
Person.people[name].wife = Person.people[person_dict["wife"]]
if "husband" in person_dict and person_dict["husband"] is not None:
Person.people[name].husband = Person.people[person_dict["husband"]]
return result_list

0 comments on commit da4b8dd

Please sign in to comment.