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

Adding answers to week 3 homework assignment. #58

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

L-Amos
Copy link

@L-Amos L-Amos commented Oct 15, 2024

Copy link

@gpwhs gpwhs left a 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()
Copy link

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):
Copy link

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 🤷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants