-
-
Notifications
You must be signed in to change notification settings - Fork 47k
Added Implementation of NAND, OR ,XNOR and NOT gates in python #7596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
boolean_algebra/nand_gate.py
Outdated
|
||
def nand_gate(input_1: int, input_2: int) -> int: | ||
""" | ||
Calculate AND of the input values |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AND -> NAND
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for pointing it out. Will do the corrections
boolean_algebra/nand_gate.py
Outdated
>>> nand_gate(1, 1) | ||
0 | ||
""" | ||
return int(not ((input_1, input_2).count(0) == 0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can directly write
return int( (input_1, input_2).count(0) != 0)
Dear @cclauss, |
Added labels!! |
Describe your change:
Checklist:
Fixes: #{$ISSUE_NO}
.