Skip to content

Instantly share code, notes, and snippets.

@knmkr
Last active December 13, 2015 18:19
Show Gist options
  • Save knmkr/4954518 to your computer and use it in GitHub Desktop.
Save knmkr/4954518 to your computer and use it in GitHub Desktop.
print bits of 'hello, world\n\0'
for c in 'hello, world\n\0':
print format(ord(c), 'b').rjust(8, '0')
# 01101000
# 01100101
# 01101100
# 01101100
# 01101111
# 00101100
# 00100000
# 01110111
# 01101111
# 01110010
# 01101100
# 01100100
# 00001010
# 00000000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment