Skip to content

Improve error messages for invalid color input in resistor-color #4049

Description

@deekshahavaragi

Currently, the resistor-color exercise raises a generic error (or unclear
exception) when an invalid color is provided.

It would be more helpful for learners if the exercise raised a ValueError
with a clear and descriptive error message, such as:

"Invalid color: pink"

This improves feedback for beginners without changing the exercise intent
or expected behavior.

Proposed change:

  • Validate color input explicitly
  • Raise ValueError with a meaningful message for invalid colors

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions