Skip to content

New version with english comments #12762

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

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Update and_gate.py
J'ai nourri ce programme en ajoutant une porte And à n entrées.
  • Loading branch information
robohie authored May 9, 2025
commit 927fc55ba9d6bca9cc4981f157ccd33bbbad9029
12 changes: 12 additions & 0 deletions boolean_algebra/and_gate.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@
return int(input_1 and input_2)


def n_and_gate(inputs: tuple) -> int:
"""

Check failure on line 36 in boolean_algebra/and_gate.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (W191)

boolean_algebra/and_gate.py:36:1: W191 Indentation contains tabs
Calcul le And de la liste des nombres
binaires fournie. Nécessaire pour
implémenter une porte And à n entrées
Par exemple
>>> n_and_gate((1, 0, 1, 1, 0))
0
"""
return int(all(inputs))

Check failure on line 44 in boolean_algebra/and_gate.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (W191)

boolean_algebra/and_gate.py:44:1: W191 Indentation contains tabs


if __name__ == "__main__":
import doctest

Expand Down
Loading