Skip to content

Conversation

@Henry-the-Sun
Copy link

Add Input Validation and Interactive Mode to N-Input AND Gate. This pull request adds input validation and an interactive mode to the N-input AND gate program. It ensures all inputs are limited to binary values (0 or 1) and provides clear error messages for invalid input. Additionally, users can now interactively enter any number of inputs to see the AND gate output calculated in real time, making the program more robust and user-friendly.

Describe your change:

Add Input Validation and Interactive Mode to N-Input AND Gate

This pull request adds input validation and an interactive mode to the N-input AND gate program. It ensures all inputs are restricted to binary values (0 or 1) and raises clear error messages for invalid or empty inputs. Additionally, users can now interactively enter any number of inputs to view the AND gate output in real time, making the program more robust, user-friendly, and suitable for educational use.

  • [YES] Add an algorithm?
  • [NO] Fix a bug or typo in an existing algorithm?
  • [NO] Add or change doctests? -- Note: Please avoid changing both code and tests in a single pull request.
  • [NO] Documentation change?

Checklist:

  • [YES] I have read CONTRIBUTING.md.
  • [YES] This pull request is all my own work -- I have not plagiarized.
  • [YES] I know that pull requests will not be merged if they fail the automated tests.
  • [YES] This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • [YES] All new Python files are placed inside an existing directory.
  • [YES] All filenames are in all lowercase characters with no spaces or dashes.
  • [YES] All functions and variable names follow Python naming conventions.
  • [YES] All function parameters and return values are annotated with Python type hints.
  • [YES] All functions have doctests that pass the automated testing.
  • [YES] All new algorithms include at least one URL that points to Wikipedia or another similar explanation.
  • [YES] If this pull request resolves one or more open issues then the description above includes the issue number(s) with a closing keyword: "Fixes #ISSUE-NUMBER".

Henry-the-Sun and others added 2 commits October 22, 2025 20:51
Add Input Validation and Interactive Mode to N-Input AND Gate. This pull request adds input validation and an interactive mode to the N-input AND gate program. It ensures all inputs are limited to binary values (0 or 1) and provides clear error messages for invalid input. Additionally, users can now interactively enter any number of inputs to see the AND gate output calculated in real time, making the program more robust and user-friendly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant