Guest User

Untitled

a guest
Apr 24th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. >> from itertools import izip_longest
  2.  
  3. >> input_list = xrange(27)
  4. >> data_to_process = izip_longest(*[iter(input_list)]*2)
  5. >> print list(data_to_process)
  6. >> [(0, 1),
  7. (2, 3),
  8. (4, 5),
  9. (6, 7),
  10. (8, 9),
  11. (10, 11),
  12. (12, 13),
  13. (14, 15),
  14. (16, 17),
  15. (18, 19),
  16. (20, 21),
  17. (22, 23),
  18. (24, 25),
  19. (26, None)]
Add Comment
Please, Sign In to add comment