Skip to content

Instantly share code, notes, and snippets.

@theredpea
Last active August 29, 2015 13:56
Show Gist options
  • Save theredpea/9333146 to your computer and use it in GitHub Desktop.
Save theredpea/9333146 to your computer and use it in GitHub Desktop.
from util import groupBy
bits='010010001111'
def translateBits(bits):
translated = [int(_,2) for _ in groupBy(bits, 3)]
return translated
print(translateBits(bits))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment