Skip to content

Commit c98bfe8

Browse files
committed
fix: enforce input length restriction for n_input_or_gate function
1 parent f0b7ea4 commit c98bfe8

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

boolean_algebra/or_gate.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ def n_input_or_gate(inputs: list[int]) -> int:
3939
>>> n_input_or_gate([1, 1, 1, 1, 1])
4040
1
4141
"""
42+
if len(inputs) > 1:
43+
raise ValueError("Input list must contain at least two elements")
44+
4245
return int(any(inputs))
4346

4447

0 commit comments

Comments
 (0)