This file contains hidden or 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
BITS = ('0', '1') | |
ASCII_BITS = 8 | |
def bit_list_to_string(b): | |
"""converts list of {0, 1}* to string""" | |
return ''.join([BITS[e] for e in b]) | |
def seq_to_bits(seq): | |
return [0 if b == '0' else 1 for b in seq] |