Will - Answers UCL-MPHY0021-21-22/RSE-Classwork#12#17
Open
will43w wants to merge 3 commits intoUCL-MPHY0021-21-22:mainfrom
Open
Will - Answers UCL-MPHY0021-21-22/RSE-Classwork#12#17will43w wants to merge 3 commits intoUCL-MPHY0021-21-22:mainfrom
will43w wants to merge 3 commits intoUCL-MPHY0021-21-22:mainfrom
Conversation
stefpiatek
reviewed
Oct 21, 2021
Collaborator
stefpiatek
left a comment
There was a problem hiding this comment.
Good fun, a couple of general suggestions but looks like it should work!
Comment on lines
+51
to
+59
| YLTWH = Group() | ||
|
|
||
| Jill = Person("Jill", 26, ["Biologist"], {"Zalika": "Friend", "John": "Partner"}) | ||
| Zalika = Person("Zalika", 28, ["Artist"], {"Jill": "Friend"}) | ||
| John = Person("John", 27, ["Writer"], {"Jill": "Partner"}) | ||
| Nash = Person("Nash", 34, ["Chef", "Landlord"], {"John": "Cousin", "Zalika": "Landlord"}) | ||
|
|
||
| for person in [Jill, Zalika, John, Nash]: | ||
| YLTWH.add_person(person) |
Collaborator
There was a problem hiding this comment.
Nice, you could have a create person method to the Group class, so that you only interact with the Group and don't need to know about the underlying person class when using the group
|
|
||
| # YLTWH.mutualize_relationships() | ||
|
|
||
| print("Maximum age of people in the group: {0}".format(YLTWH.hwkq1_max_age())) |
Collaborator
There was a problem hiding this comment.
if you're using python 3.6+ you can use f strings here
Suggested change
| print("Maximum age of people in the group: {0}".format(YLTWH.hwkq1_max_age())) | |
| print(f"Maximum age of people in the group: {YLTWH.hwkq1_max_age()}") |
| # except: | ||
| # pass | ||
|
|
||
| def hwkq1_max_age(self): |
Collaborator
There was a problem hiding this comment.
after a while I worked out it home work question 1 at a prefix. it's a dummy example so I get why but overall I'd go for a longer name so it's more readable like homework_1_max_age
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Homework from UCL-MPHY0021-21-22/RSE-Classwork#12