Guest User

Untitled

a guest
Jan 19th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. a = [9, 1, 9, 74888, 29, 2, 29, 55586, 29, 2, 29, 19827,
  2. 23, 2, 23, 62839, 50, 3, 50, 56642]
  3.  
  4. a = [[9, 1, 9, 74888],
  5. [29, 2, 29, 55586],
  6. [29, 2, 29, 19827],
  7. [23, 2, 23, 62839],
  8. [50, 3, 50, 56642]]
  9.  
  10. In [24]: N=4
  11.  
  12. In [25]: res = [a[i*N:i*N+N] for i in range(len(a)//N)]
  13.  
  14. In [26]: res
  15. Out[26]:
  16. [[9, 1, 9, 74888],
  17. [29, 2, 29, 55586],
  18. [29, 2, 29, 19827],
  19. [23, 2, 23, 62839],
  20. [50, 3, 50, 56642]]
Add Comment
Please, Sign In to add comment