Skip to content

London|25-SDC-NOV| FATMA DEGIRMENCI | Sprint 5|Prep exercise Python#315

Open
fatmaevin wants to merge 11 commits intoCodeYourFuture:mainfrom
fatmaevin:prep-exercise
Open

London|25-SDC-NOV| FATMA DEGIRMENCI | Sprint 5|Prep exercise Python#315
fatmaevin wants to merge 11 commits intoCodeYourFuture:mainfrom
fatmaevin:prep-exercise

Conversation

@fatmaevin
Copy link

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

@fatmaevin fatmaevin added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 📅 Sprint 5 Assigned during Week 5 of this module labels Jan 12, 2026
Copy link

@LonMcGregor LonMcGregor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good start on this sprint's tasks, I have spotted a few areas where you could improve code further

Remember to include a summary of the changes in the pull request text.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain the difference between methods and functions, and any benefits/disadvantages?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Functions are independent and can be used anywhere.
  • Methods are defined inside a class and usually work with the object’s data.
  • Functions can be reused, but to use object data, you need to pass it as a parameter.
  • Methods can access and change object data and help keep the code organized, but you need to create an object to use them.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good answers!

def print_family_tree(person: Person) -> None:
print(person.name)
for child in person.children:
print(f"- {child.name} ({child.age})")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you figure out how to recursively print a full family tree, like grandchildren as well?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain why the errors in this file occur?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got errors because the Parent class only has the get_name method. It cannot use the methods in the Child class. But when we create a Child object, it has all Parent methods and its own methods, so no errors happen. I commented out the lines that would give errors.

sprint5/enums.py Outdated

try:
age = int(age_input)
except ValueError:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When taking input, consider the user experience. Right now it asks or all the input and if there are problems it quits and you have to try again. Could you improve this?

@LonMcGregor LonMcGregor added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Jan 21, 2026
@fatmaevin fatmaevin added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 2, 2026
@LonMcGregor
Copy link

good work on this task, it looks complete to me

@LonMcGregor LonMcGregor added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Reviewed Volunteer to add when completing a review with trainee action still to take. labels Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed. 📅 Sprint 5 Assigned during Week 5 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants