Skip to content

Instantly share code, notes, and snippets.

@inky
Created September 24, 2014 23:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save inky/fe56fdd2b7969b1e65b3 to your computer and use it in GitHub Desktop.
Save inky/fe56fdd2b7969b1e65b3 to your computer and use it in GitHub Desktop.
def str_to_binary(a_string):
return ' '.join(format(ord(c), 'b').zfill(8) for c in a_string)
def ello_string(a_string):
return str_to_binary(a_string).replace('0', 'O').replace('1', 'L')
print ello_string('ello orld')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment