Skip to content

Instantly share code, notes, and snippets.

@Hammer2900
Created May 22, 2015 09:41
Show Gist options
  • Save Hammer2900/0576dec8d5c66817c480 to your computer and use it in GitHub Desktop.
Save Hammer2900/0576dec8d5c66817c480 to your computer and use it in GitHub Desktop.
python list to N dicts
a = [1,2,3,4,5,6,7,8]
print zip(*[iter(a)]*3)
#[(1, 2, 3), (4, 5, 6)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment