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

Function is_for_table

boolean_algebra/quine_mc_cluskey.py:67–78  ·  view source on GitHub ↗

>>> is_for_table('__1','011',2) True >>> is_for_table('01_','001',1) False

(string1: str, string2: str, count: int)

Source from the content-addressed store, hash-verified

65
66
67def is_for_table(string1: str, string2: str, count: int) -> bool:
68 """
69 >>> is_for_table('__1','011',2)
70 True
71
72 >>> is_for_table('01_','001',1)
73 False
74 """
75 list1 = list(string1)
76 list2 = list(string2)
77 count_n = sum(item1 != item2 for item1, item2 in zip(list1, list2))
78 return count_n == count
79
80
81def selection(chart: list[list[int]], prime_implicants: list[str]) -> list[str]:

Callers 1

prime_implicant_chartFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected