The algorithm of reverse cipher holds the following features -
message = 'reverse cipher.'
translated = ''
i = len(message) - 1
while i >= 0:
translated = translated + message[i]
i = i - 1
print(%u201CThe cipher text is : %u201C, translated)
Plain text is stored in the variable message and the translated variable is used to store the cipher text created.
The length of plain text is calculated using for loop and with help of index number. The characters are stored in cipher text variable translated which is printed in the last line.
Comments