def bitswap(s):
 out = []
 for c in s:
  out.append(unbits(bits_str(c)[::(-1)]))
 return ''.join(out)

def bitswap ( s ) : out = [ ] for c in s : out . append ( unbits ( bits_str ( c ) [ : : ( - 1 ) ] ) ) return '' . join ( out )
bitswap(s) -> str reverses the bits in every byte of a given string .