Created
October 10, 2018 18:40
-
-
Save shpigunov/d59a38e9d6a273980464fb509f00fd42 to your computer and use it in GitHub Desktop.
RUINER bin read and write
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def write_bin(s): | |
return ' '.join(format(ord(x), 'b') for x in s) | |
def read_bin(s): | |
return ''.join([chr(int(c, 2)) for c in s.split()]) | |
read_bin("01010100 01110101 01100101 01110011 01100100 01100001 01111001") | |
write_bin("Tuesday") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment