The question is from hacker.org's Challenge 'didactic Bytes '[Crypto]
A password consisting of 01 strings is provided to find the decrypted word.
01110101 01110011 01100101 00100000 01110111 01100101 01100100 01101110 01100101 01110011 01100100 01100001 01111001 00100000 01100110 01101111 01110010 00100000 01110100 01101000 01100101 00100000 01100001 01101110 01110011 01110111 01100101 01110010
It is observed that each 01 string is an 8-bit binary number starting with 0. Therefore, it is converted into a decimal range of less than 127, which is associated with the ASCII code.
---
s = "01110101 01110011 01100101 00100000 01110111 01100101 01100100 01101110 01100101 01110011 01100100 01100001 01111001 00100000 01100110 01101111 01110010 00100000 01110100 01101000 01100101 00100000 01100001 01101110 01110011 01110111 01100101 01110010"bit = s.split()dec = map(lambda x:int(x,2),bit)print ''.join(map(chr,dec))
---
Store the password in variable s as a string
Str. split () separates strings with spaces and saves the results to the bit list in the form of a list.
Use map to execute int (x, 2) on each string in the bit list, convert a string of binary numbers to decimal, and save the result list to dec.
Use chr () to convert the decimal number in the dec list to a character, and use str. join (iterable) to convert the character list to a string and output it.