>>> decimal_to_binary(3,[1.5]) ['0.00.01.5']
(no_of_variable: int, minterms: Sequence[float])
| 50 | |
| 51 | |
| 52 | def decimal_to_binary(no_of_variable: int, minterms: Sequence[float]) -> list[str]: |
| 53 | """ |
| 54 | >>> decimal_to_binary(3,[1.5]) |
| 55 | ['0.00.01.5'] |
| 56 | """ |
| 57 | temp = [] |
| 58 | for minterm in minterms: |
| 59 | string = "" |
| 60 | for _ in range(no_of_variable): |
| 61 | string = str(minterm % 2) + string |
| 62 | minterm //= 2 |
| 63 | temp.append(string) |
| 64 | return temp |
| 65 | |
| 66 | |
| 67 | def is_for_table(string1: str, string2: str, count: int) -> bool: |