-
-
Notifications
You must be signed in to change notification settings - Fork 42
London | 25-SDC-Nov | Zohreh Kazemianpour | Sprint 5 | Prep Exercises #305
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
base: main
Are you sure you want to change the base?
London | 25-SDC-Nov | Zohreh Kazemianpour | Sprint 5 | Prep Exercises #305
Conversation
LonMcGregor
left a comment
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.
Very good work on these tasks, there are some areas where you could improve further
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.
Can you describe the difference and any dis/advantage of using a class method vs a function?
| self.preferred_operating_system = preferred_operating_system | ||
|
|
||
| def is_adult(self) -> bool: | ||
| today_date = date.today().year |
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.
Be careful about the formatting and indentation here
| def print_family_tree(person: Person) -> None: | ||
| print(person.name) | ||
| for child in person.children: | ||
| print(f"- {child.name} ({child.age})") |
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.
Can this print grandchildren recursively?
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.
To improve the user experience, you might want to do some validation on the input and ask for reentry if it is invalid. You might also want to give some options when asking for an OS
Learners, PR Template
Self checklist
Changelist
This PR contains the Sprint 5 preparation exercise.
As I was not previously familiar with Python, it took me some time to get comfortable with the new concepts and syntax. I added as many comments as possible for educational purposes, as I plan to use this code later as a reference.
Questions
I would really appreciate any feedback on my implementation and suggestions on how I can improve my code quality.