Skip to content

Instantly share code, notes, and snippets.

View JustParsa's full-sized avatar

Parsa Alipour JustParsa

View GitHub Profile
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]