Skip to content

Latest commit

 

History

History
6 lines (6 loc) · 163 Bytes

File metadata and controls

6 lines (6 loc) · 163 Bytes

Slice a string in equal parts in array

  • string = 'aabcdefcn' k = 3
  • output = ['aab', 'cde', 'fcn']
List = list(map(''.join, zip(*[iter(string)]*k)))