Skip to content

Add Input Validation for Grade Range #3

@swaparup36

Description

@swaparup36

The add_grade() method calls validate_grade() but we should also add validation for negative numbers and non-numeric inputs.

Task:

  • Enhance the validation in add_grade() method
  • Add type checking for the grade parameter
  • Raise appropriate exceptions with clear messages

Expected Behavior:

manager.add_grade("Math", -5)    # Should raise ValueError
manager.add_grade("Math", "A+")  # Should raise TypeError

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions