Skip to content

Adding answers to week 3 homework assignment.#58

Open
L-Amos wants to merge 15 commits intoUCL-COMP0233-24-25:mainfrom
L-Amos:luke
Open

Adding answers to week 3 homework assignment.#58
L-Amos wants to merge 15 commits intoUCL-COMP0233-24-25:mainfrom
L-Amos:luke

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