Computational-Analysis/chapter-03/binseq/binseq.py
Jan-Niclas Loosen 26118be87f optimize ux
2025-04-17 18:08:18 +02:00

11 lines
262 B
Python

from collections.abc import Callable
class REAL:
def __init__(self, f: Callable[[int], str]) -> None:
self.binseq = f
def as_string(self, w: int) -> str:
s = ""
for n in range(w):
s += self.binseq(n)
return s