London | 25-SDC-Nov | Emiliano Uruena | Sprint 5 | Prep Exercises#306
London | 25-SDC-Nov | Emiliano Uruena | Sprint 5 | Prep Exercises#306Emilianouz wants to merge 3 commits intoCodeYourFuture:mainfrom
Conversation
This file is not necessary.
LonMcGregor
left a comment
There was a problem hiding this comment.
Very good work on these tasks, there are some areas where you could improve further
There was a problem hiding this comment.
You should not need to change files in other directories, is there a reason you changed this?
There was a problem hiding this comment.
Can you describe the difference and any dis/advantage of using a class method vs a function?
| 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.
Can this print grandchildren recursively?
There was a problem hiding this comment.
The output here could be neater, it is generally not a good idea to print objects directly to user facing interfaces.
Good idea to allow using numbers for quicker data entry.
You might want to consider adding a bit more data validation in case the input is incorrect, e.g. if I type a letter instead of a number for age
Self checklist
Changelist
Completed all Sprint 5 prep exercises following the provided guide.
This includes: object-oriented programming concepts such as classes, inheritance, methods, dataclasses, enums, and generics.
Also worked through mypy type checking and type-guided refactoring to reinforce static typing and code quality.