Linux
- 2 ответа
- 0 вопросов
2
Вклад в тег
from itertools import cycle
test = [secretkey[i:i + 3]+l for i, l in zip(range(0, len(secretkey), 3), cycle(id))]
from itertools import cycle
def chunks(l, n):
""" Yield successive n-sized chunks from l."""
for i in xrange(0, len(l), n):
yield l[i:i+n]
test = [ chunk + number
for chunk, number in zip(chunks(secretkey, 3), cycle(id)) ]