Jun-17-2019, 11:50 PM
I am not sure what means summation, may be string concatenation in this case.
Hope the following code helps you:
Hope the following code helps you:
mystring = 'My beautiful house' def word2bin(w): return '0b' + ''.join('{0:08b}'.format(ord(x), 'b') for x in w) bin(sum(map(lambda x: int(x, 2), (word2bin(x) for x in mystring.split()))))