Skip to content

Conversation

@Geraldine-Edwards
Copy link

Learners, PR Template

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

Changelist

This PR contains the logic for implementing the laptop allocation task

Questions

Grateful for any feedback or points to consider. Thanks!

@Geraldine-Edwards Geraldine-Edwards added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Dec 6, 2025
@OracPrime OracPrime added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Dec 27, 2025
Copy link

@OracPrime OracPrime left a comment

Choose a reason for hiding this comment

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

Couple of suggested tweaks. First one more important...

# strip() whitespace before processing (no need for str type here as input always returns a string)
name = input("Please enter your first name: ").strip()
if not name.isalpha():
raise ValueError("Name must contain only alphabetic characters.")

Choose a reason for hiding this comment

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

Scarlett O'Hara might be disappointed with this parsing...

Copy link
Author

Choose a reason for hiding this comment

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

Thanks David, yes as before, I have been quite lazy about the validation - I must always remember to cover edge cases! Added validation for the first name. :)


if len(allocated_laptops) != len(people):
raise ValueError("Not enough laptops to allocate one to each person.")

Choose a reason for hiding this comment

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

This is an "OK" solution. You might want to google Kuhn-Munkres algorithm to see how it could be improved (no need to resubmit for this, this is advanced voodoo)

Copy link
Author

Choose a reason for hiding this comment

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

I actually came across this algorithm when I was researching how to reduce 'sadness' for everyone but in all honesty I was a bit overwhelmed with it because the article mentioned a cost matrix and it scared me off! ( I think it was just a bit much for me at that time truth be told)

Choose a reason for hiding this comment

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

That was younger you. You're wiser now :)

@OracPrime OracPrime 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. Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Dec 27, 2025
…ces in names and embed minimum age variable into age validation for accuracy.
@Geraldine-Edwards Geraldine-Edwards added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Jan 2, 2026
@OracPrime OracPrime added Reviewed Volunteer to add when completing a review with trainee action still to take. 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. labels Jan 2, 2026
@OracPrime
Copy link

I've added Reviewed and Complete despite adding more comments, because in the context of this exercise you've done enough!

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. Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants