Guest User

Untitled

a guest
May 26th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.17 KB | None | 0 0
  1. >>> def x(lst, cols):
  2. ... if cols == 0: return []
  3. ... slice = len(lst) / cols
  4. ... if len(lst) % cols:
  5. ... slice += 1
  6. ... return [lst[:slice]] + x(lst[slice:], cols-1)
Add Comment
Please, Sign In to add comment