def random_bitstring(n):
 return ''.join([random.choice('01') for i in range(n)])

def random_bitstring ( n ) : return '' . join ( [ random . choice ( '01' ) for i in range ( n ) ] )
generates a random bitlist of length n .