Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update main.py #801

Open
wants to merge 41 commits into
base: master
Choose a base branch
from
Open
Changes from 3 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
da64105
Update main.py
mikesanin Oct 12, 2023
b72b328
Update main.py
mikesanin Oct 12, 2023
29cd884
Update main.py
mikesanin Oct 12, 2023
2f0d486
Update main.py
mikesanin Oct 12, 2023
9b35a73
Update main.py
mikesanin Oct 22, 2023
e75523d
Update main.py
mikesanin Oct 22, 2023
afc46b0
Update main.py
mikesanin Oct 22, 2023
67b5680
Update main.py
mikesanin Oct 22, 2023
c3f14f4
Update main.py
mikesanin Oct 22, 2023
d41237e
Update main.py
mikesanin Oct 22, 2023
3f8c4fb
Update main.py
mikesanin Oct 22, 2023
86d2769
Update main.py
mikesanin Oct 22, 2023
b84fe41
Update main.py
mikesanin Oct 22, 2023
7ce55d9
Update main.py
mikesanin Oct 22, 2023
03cb4fd
Update main.py
mikesanin Oct 22, 2023
bdf8f65
Update main.py
mikesanin Oct 22, 2023
4a7db02
Update main.py
mikesanin Oct 22, 2023
79e90a7
Update main.py
mikesanin Nov 14, 2023
8e69db2
Update main.py
mikesanin Nov 14, 2023
b2b432e
Update main.py
mikesanin Nov 14, 2023
cd1df3f
Update main.py
mikesanin Nov 14, 2023
901af85
Update main.py
mikesanin Nov 14, 2023
2929b47
Update main.py
mikesanin Dec 6, 2023
63d35e3
Update main.py
mikesanin Dec 6, 2023
43133d7
Update main.py
mikesanin Dec 6, 2023
d466588
Update main.py
mikesanin Dec 14, 2023
1227fd4
Update main.py
mikesanin Feb 11, 2024
cbe97eb
Update main.py
mikesanin Feb 11, 2024
7f0c722
Update main.py
mikesanin Feb 11, 2024
7bc3860
Update main.py
mikesanin Feb 11, 2024
4ac340a
Update main.py
mikesanin Feb 11, 2024
83c52e4
Update main.py
mikesanin Feb 11, 2024
ddb84c1
Update main.py
mikesanin Feb 11, 2024
b0da72e
Update main.py
mikesanin Feb 11, 2024
f022065
Update main.py
mikesanin Feb 11, 2024
6196345
Update main.py
mikesanin Feb 11, 2024
b808718
Update main.py
mikesanin Feb 11, 2024
ba0be16
Update main.py
mikesanin Feb 11, 2024
56e93fe
Update main.py
mikesanin Jun 5, 2024
0b5e6d0
Update main.py
mikesanin Jun 5, 2024
5b69294
Update main.py
mikesanin Jun 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 27 additions & 5 deletions app/main.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,30 @@
from typing import List, Union


class Person:
# write your code here
pass
people = {}

def __init__(self, name: str, age: int) -> None:
self.name = name
self.age = age
self.wife: Union[None, "Person"] = None
self.husband: Union[None, "Person"] = None
Person.people[name] = self


def create_person_list(people: list) -> list:
# write your code here
pass
def create_person_list(people: List[dict]) -> List[Person]:
person_list = []
for person_dict in people:
name = person_dict["name"]
age = person_dict["age"]
person = Person(name, age)
if "wife" in person_dict and person_dict["wife"]:
person.wife = Person.people.get(person_dict["wife"])
if person.wife:
person.wife.husband = person
if 'husband' in person_dict and person_dict["husband"]:
person.husband = Person.people.get(person_dict["husband"])
if person.husband:
person.husband.wife = person
person_list.append(person)
return person_list
Loading