Skip to content

Instantly share code, notes, and snippets.

@agocs
Created October 29, 2013 20:55
Show Gist options
  • Save agocs/7222436 to your computer and use it in GitHub Desktop.
Save agocs/7222436 to your computer and use it in GitHub Desktop.
A way to find the binary value of an 8 bit number in python.
n = 100
for i in range(8):
print((n>>i)%2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment