MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / check

Function check

boolean_algebra/quine_mc_cluskey.py:28–49  ·  view source on GitHub ↗

>>> check(['0.00.01.5']) ['0.00.01.5']

(binary: list[str])

Source from the content-addressed store, hash-verified

26
27
28def check(binary: list[str]) -> list[str]:
29 """
30 >>> check(['0.00.01.5'])
31 ['0.00.01.5']
32 """
33 pi = []
34 while True:
35 check1 = ["$"] * len(binary)
36 temp = []
37 for i in range(len(binary)):
38 for j in range(i + 1, len(binary)):
39 k = compare_string(binary[i], binary[j])
40 if k is False:
41 check1[i] = "*"
42 check1[j] = "*"
43 temp.append("X")
44 for i in range(len(binary)):
45 if check1[i] == "$":
46 pi.append(binary[i])
47 if len(temp) == 0:
48 return pi
49 binary = list(set(temp))
50
51
52def decimal_to_binary(no_of_variable: int, minterms: Sequence[float]) -> list[str]:

Callers 1

mainFunction · 0.70

Calls 2

compare_stringFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected