Python_ Split String into n-size pieces

def split_len(seq, length):
    return [seq[i:i+length] for i in range(0, len(seq), length)]

Reference: Split String into n-size pieces

Homepage
Comments

Hide Comments