Lyxica

chunk_str

Jan 30th, 2021
1,587
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.14 KB | None | 0 0
  1. def chunk_str(input: str, size: int) -> Iterator[str]:
  2.     n = 0
  3.     while n < len(input):
  4.         yield input[n : n + size]
  5.         n += size
Advertisement
Add Comment
Please, Sign In to add comment