-
Notifications
You must be signed in to change notification settings - Fork 67
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
Adding answers to week 3 homework assignment. #58
base: main
Are you sure you want to change the base?
Conversation
…culation of mean connections.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generally good, i'd suggest:
- docstrings on functions
- raise exceptions like ValueError instead of printing
max_age_with_friends = np.max([person["age"] for person in my_group.values() if "friend" in person["connections"].values()]) | ||
print(max_age_with_friends) | ||
|
||
homework() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will run whenever you import group.py i believe, probably don't want to run this here. Use if name == "main":
if job and not isinstance(job, str): | ||
print("Job must be string") | ||
return | ||
if relations and not isinstance(relations, dict): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good checks, happy w this, maybe you can check if the keys in relations exist but 🤷
Answers UCL-COMP0233-24-25/RSE-Classwork#7.