Skip to content

Instantly share code, notes, and snippets.

@dropwhile
Created June 15, 2012 03:56
Show Gist options
  • Save dropwhile/2934592 to your computer and use it in GitHub Desktop.
Save dropwhile/2934592 to your computer and use it in GitHub Desktop.
>>> rows = [(1,2,3), (4,5,6), (7,8,9)]
>>> [','.join(map(str,row[offset:offset+3]))
... for offset in range(0, len(rows) / 3)
... for row in rows]
['1,2,3', '4,5,6', '7,8,9']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment