Skip to content

Commit

Permalink
new variables name
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey1104 committed Oct 22, 2023
1 parent 443b6ba commit 880c8cf
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ def __init__(self, name: str, age: int) -> None:


def create_person_list(people: list) -> list:
friends = [Person(someone["name"], someone["age"]) for someone in people]
for friend in friends:
humans = [Person(person["name"], person["age"]) for person in people]
for human in humans:
for person in people:
if "wife" in person \
and person["wife"] is not None \
and friend.name == person["name"]:
friend.wife = Person.people[person["wife"]]
if (
"wife" in person
and person["wife"] is not None
and human.name == person["name"]
):
human.wife = Person.people[person["wife"]]
elif "husband" in person and person["husband"] is not None:
friend.husband = Person.people[person["husband"]]
return friends
human.husband = Person.people[person["husband"]]
return humans

0 comments on commit 880c8cf

Please sign in to comment.