Skip to content

Glasgow | 25-SDC-NOV | Katarzyna Kazimierczuk | Sprint 5 | laptop task function#328

Open
katarzynakaz wants to merge 1 commit intoCodeYourFuture:mainfrom
katarzynakaz:laptop-allocation-task-branch
Open

Glasgow | 25-SDC-NOV | Katarzyna Kazimierczuk | Sprint 5 | laptop task function#328
katarzynakaz wants to merge 1 commit intoCodeYourFuture:mainfrom
katarzynakaz:laptop-allocation-task-branch

Conversation

@katarzynakaz
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

Changelist

This is the laptop allocation task with the logic changed from the previous work.

@katarzynakaz katarzynakaz 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 Feb 14, 2026
@OracPrime OracPrime added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Feb 28, 2026
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.

It could do with some error checking on the OS choices - although most people just used test data rather than asking for user input, so I'd suggest make a note of this for future use, but don't bother adding it here.

I'd also suggest a loop rather than the duplicated code. However I'm sure you understand the suggestion, so there's no need at this stage to fix it (given how much of a review backlog we volunteers have built up!)

So while there is room for improvement, I think it's close enough to approve.

sys.exit(1)

add_age = int(input("What is your age? \n"))
if add_age < 0 or add_age > 100:

Choose a reason for hiding this comment

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

Pessimistic view of life expectancy :(

def create_a_new_person() -> Person:
add_name = input("What is your name? \n").title()
if not add_name or add_name == "" or len(add_name) > 50:
print("Enter a valid name.", file=sys.stderr)

Choose a reason for hiding this comment

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

I'm Liking the stderr for error messages!

# user_oss_ranked_as_enums = [choice1, choice2, choice3]
# or shorter
#here i have strings converted to enums so can compare
user_oss_ranked_as_enums = [

Choose a reason for hiding this comment

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

What happens if what they enter doesn't match any of the values?

if laptop.operating_system == person.preferred_operating_system[0]:
return laptop, 0

for laptop in laptops:

Choose a reason for hiding this comment

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

It's a bit odd having this written out 3 times rather than a loop

@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. Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Feb 28, 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. Reviewed Volunteer to add when completing a review with trainee action still to take. 📅 Sprint 5 Assigned during Week 5 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants