Skip to content

Commit

Permalink
add function placeholders for
Browse files Browse the repository at this point in the history
  • Loading branch information
shiyingwucl committed Oct 15, 2024
1 parent 4f6daf5 commit 479b697
Showing 1 changed file with 34 additions and 16 deletions.
50 changes: 34 additions & 16 deletions group.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,40 @@
# Your code to go here...

my_group = [{"Jill":{"age": 26,
"job": "biologist",
"connection":{"Zalika":"friend",
"John":"partner"}
}
},
"job": "biologist",
"connection":{"Zalika":"friend",
"John":"partner"}
}
},
{"Zalika":{"age": 28,
"job": "artist",
"connection":{"Jill":"friend"}
}
},
"job": "artist",
"connection":{"Jill":"friend"}
}
},
{"John":{"age": 27,
"job": "writer",
"connection":{"Jill":"partner"}}
},
"job": "writer",
"connection":{"Jill":"partner"}
}
},
{"Nash":{"age": 34,
"job": "chef",
"connection":{"John":"cousin",
"Zalika":"landlord"}}
}]
"job": "chef",
"connection":{"John":"cousin",
"Zalika":"landlord"}
}
}]

#returns the max age
def max_age(friend_group):
ages = []
for person in friend_group:
for name in person.values():
age = name.get("age")
ages.append(age)
print(max(ages))

def mean_relation():
pass
def max_age_with_relation():
pass

max_age(my_group)

0 comments on commit 479b697

Please sign in to comment.