Null Cipher | Function to decode the message . ; Store the decoded string ; found variable is used to tell that the encoded encoded character is found in that particular word . ; Set found variable to false whenever we find whitespace , meaning that encoded character for new word is not found ; Driver code
def decode ( string ) : NEW_LINE INDENT res = " " NEW_LINE found = False NEW_LINE for character in string : NEW_LINE INDENT if character == ' ▁ ' : NEW_LINE INDENT found = False NEW_LINE continue NEW_LINE DEDENT if not found : NEW_LINE INDENT if character >= ' A ' and character <= ' Z ' or character >= ' a ' and character <= ' z ' : NEW_LINE INDENT res += character NEW_LINE found = True NEW_LINE DEDENT DEDENT DEDENT return res . lower ( ) NEW_LINE DEDENT if __name__ == " _ _ main _ _ " : NEW_LINE INDENT input = " A ▁ Step ▁ by ▁ Step ▁ Guide ▁ for ▁ Placement ▁ Preparation ▁ by ▁ GeeksforGeeks " NEW_LINE print ( " Enciphered ▁ Message : " , decode ( input ) ) NEW_LINE DEDENT