Skip to content

London | 26-Jul-SDC | Alex Jamshidi | Sprint 5 | Prep Exercises - #680

Open
Alex-Jamshidi wants to merge 46 commits into
CodeYourFuture:mainfrom
Alex-Jamshidi:prep-exercises
Open

London | 26-Jul-SDC | Alex Jamshidi | Sprint 5 | Prep Exercises#680
Alex-Jamshidi wants to merge 46 commits into
CodeYourFuture:mainfrom
Alex-Jamshidi:prep-exercises

Conversation

@Alex-Jamshidi

Copy link
Copy Markdown

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

Task code

CYF-1155

Changelist

Exercises from sprint 5 prep completed

@Alex-Jamshidi Alex-Jamshidi added 📅 Sprint 5 Assigned during Week 5 of this module Module-Tools The name of the module. labels Sep 1, 2026
@Alex-Jamshidi Alex-Jamshidi added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 1, 2026

@LonMcGregor LonMcGregor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good work on these tasks. Most of them are good, I have a few questions about some of them

# Think of the advantages of using methods instead of free functions. Write them down in your notebook.

# Better readability of code
# Encapsulation of that function only to class - cleaner and better security. No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you expand on these explanations or think of any other benefits / drawbacks?

def is_adult(self):
dob = self.dob
today = date.today()
if dob.year > today.year - 18: return False

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This sequence of if conditions feels a little complicated. Is there anything you could change to improve it / make it more readable / simplify it?

# exercise_10.py:29: error: Unexpected keyword argument "preferred_operating_system" for "Person"; did you mean "preferred_operating_systems"? [call-arg]
# exercise_10.py:30: error: Unexpected keyword argument "preferred_operating_system" for "Person"; did you mean "preferred_operating_systems"? [call-arg]

# Fix all of the places that mypy tells you need changing. Make sure the program works as you’d expect. No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

When I run this I get two empty lists. Is that the expected output?

user_operating_system_str = input("Please enter your preferred operating system (options: ARCH, UBUNTU, MACOS, WINDOWS):\n")

if user_operating_system_str not in OperatingSystem.__members__:
sys.exit("Error: Operating system should be written in all caps from given options.")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there any change you could make to the UX to make this more forgiving, rather than requiring the user to write their input in such a strict format?

@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 Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module-Tools The name of the module. 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