kyu_8.logical_calculator package

Submodules

kyu_8.logical_calculator.logical_calculator module

kyu_8.logical_calculator.logical_calculator.logical_calc(array: list, op: str) → bool[source]

Calculates logical value of boolean array.

Logical operations: AND, OR and XOR.

Begins at the first value, and repeatedly apply the logical operation across the remaining elements in the array sequentially.

Parameters
  • array

  • op

Returns

kyu_8.logical_calculator.test_logical_calculator module

class kyu_8.logical_calculator.test_logical_calculator.LogicalCalculatorTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Testing logical_calc function

test_logical_calc_and()[source]

And (∧) is the truth-functional operator of logical conjunction

The and of a set of operands is true if and only if all of its operands are true.

Source: https://en.wikipedia.org/wiki/Logical_conjunction

Returns

test_logical_calc_or()[source]

In logic and mathematics, or is the truth-functional operator of (inclusive) disjunction, also known as alternation.

The or of a set of operands is true if and only if one or more of its operands is true.

Source: https://en.wikipedia.org/wiki/Logical_disjunction

Returns

test_logical_calc_xor()[source]

Exclusive or or exclusive disjunction is a logical operation that outputs true only when inputs differ (one is true, the other is false).

XOR outputs true whenever the inputs differ:

Source: https://en.wikipedia.org/wiki/Exclusive_or :return:

Module contents