Skip to content

Instantly share code, notes, and snippets.

@brk3
Created March 27, 2012 10:09
Show Gist options
  • Save brk3/2214568 to your computer and use it in GitHub Desktop.
Save brk3/2214568 to your computer and use it in GitHub Desktop.
n = '1000000'
r = list(n)
r.reverse()
ret = []
for i,j in enumerate(r):
if i % 3 == 0 and i != 0:
ret.append(',')
ret.append(j)
ret.reverse()
print(''.join(ret))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment