-
Notifications
You must be signed in to change notification settings - Fork 69
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
Friend Group data structure and accompanying functions from COMP0233 session 14/10/2024 #47
base: main
Are you sure you want to change the base?
Friend Group data structure and accompanying functions from COMP0233 session 14/10/2024 #47
Conversation
…the example (changed the order of the relationships)
…t least one friend
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 use of list comprehensions in places, but you can probably use them more instead of using append
use max() etc instead of creating lists in memory
check bidirectional relationships stay symmetrical on removal etc
add error handling + wrap in if name == "main":
check how many times you're looping through my_group? you might be able to bring it down
add error handling
add if name == "main"
…quest. Replaced all append() operations with list comprehensions for more efficient and concise code, used max() directly within loops instead of storing values in intermediate lists, added bidirectional relationship handling in the forget_person function (so that both people have the relationship removed), and added error handling and main block.
…week 4 pre-lecture task 1.
Answers UCL-COMP0233-24-25/RSE-Classwork #5,#6,#7