CoreyMSchafer / code_snippets

MIT License
10.36k stars 17.55k forks source link

Update employee.py #216

Closed MIGithubSE closed 8 months ago

MIGithubSE commented 8 months ago

Currently, the Employee class accepts first, last, and pay parameters without any validation, potentially leading to invalid or inconsistent employee data. Implementing validation checks for these inputs will enhance the robustness and reliability of the class.

Proposed Changes:

Validate the first and last name inputs to ensure they are not empty and are of type str.
Ensure that the pay attribute is a positive number and of type int or float.
MIGithubSE commented 8 months ago

Validated the first and last name inputs to ensure they are not empty and are of type str. Ensured that the pay attribute is a positive number and of type int or float.