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

Function chunker

ciphers/playfair_cipher.py:27–33  ·  view source on GitHub ↗
(seq: Iterable[str], size: int)

Source from the content-addressed store, hash-verified

25
26
27def chunker(seq: Iterable[str], size: int) -> Generator[tuple[str, ...]]:
28 it = iter(seq)
29 while True:
30 chunk = tuple(itertools.islice(it, size))
31 if not chunk:
32 return
33 yield chunk
34
35
36def prepare_input(dirty: str) -> str:

Callers 2

encodeFunction · 0.85
decodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected