Skip to content

Instantly share code, notes, and snippets.

@Dav1dde
Created June 9, 2012 13:51
Show Gist options
  • Save Dav1dde/2901043 to your computer and use it in GitHub Desktop.
Save Dav1dde/2901043 to your computer and use it in GitHub Desktop.
In [47]: x = '0b111111111111111111111111'
In [48]: x = x[2:]
In [49]: for i in range(6): # 24/4
....: print x[i:i*4]
....:
111
111111
111111111
111111111111
111111111111111
In [50]: for i in range(6): # 24/4
print x[i*4:(i+1)*4]
....:
1111
1111
1111
1111
1111
1111
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment