3 ms·
>>> len(''.join(map(lambda x: bin(ord(x))[2:], "I'm wrong"))) 61
by candiodari 9y ago
>>> len(''.join(map(lambda x: bin(ord(x))[2:], "I'm wrong")))
61
- schoen 9y agoHee hee! But your joke is probably more precise if you write it as 8 * len("I'm wrong") since the leading 0 bits still get sent on printable ASCII characters.
- james_a_craig 9y agoCome on, you need to encode it if you're counting bytes not characters, even if that's equivalent for this particular string. :) 8*len("I'm wrong".encode('utf-8'))