Skip to content

Commit

Permalink
Testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Damodar-kumar committed Oct 27, 2023
1 parent e075ff6 commit 46c6642
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions app/main.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
class Person:
# write your code here
pass
people = {}
def __init__(self, name: str, age: int):
self.name = name
self.age = age
self.people[self.name] = self


def create_person_list(people: list) -> list:
# write your code here
pass
person_instances = []
for human in people:
person_instances.append(Person.people[human["name"]])
for key in human:
if key == "wife" and human["wife"] is not None:
person_instances[-1].wife = Person.people[human["wife"]]
elif key == "husband" and human["husband"] is not None:
person_instances[-1].husband = Person.people[human["husband"]]
return person_instances


0 comments on commit 46c6642

Please sign in to comment.