Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Wk3 Homework #54

Closed
wants to merge 2 commits into from
Closed

Wk3 Homework #54

wants to merge 2 commits into from

Conversation

Danqing-Huang
Copy link

Comment on lines +41 to +50
print(max([group[key]['age'] for key in group]))

# average number of relations
print(sum([len(group[key]['relations']) for key in group])/ len(group))

# maximum age of people that have at least one relation
print(max([group[key]['age'] for key in group if group[key]['relations']]))

# maximum age of people that have at least one friend
print(max([group[key]['age'] for key in group if group[key]['relations'] if 'friend' in group[key]['relations'].values()]))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants