Last active
August 12, 2020 12:51
-
-
Save dipo1/17e2037304e817266bdf6cc314e1efd4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def solution(x): | |
encrypted_message_characters = list(x) | |
decrypted_message_characters = [] | |
lowercase_characters = [chr(i) for i in range(ord('a'), ord('z') + 1)] | |
for character in encrypted_message_characters: | |
if(character in lowercase_characters): | |
decrypted_message_characters.append(lowercase_characters[len(lowercase_characters) - 1 - lowercase_characters.index(character)]) | |
else: | |
decrypted_message_characters.append(character) | |
decrypted_message = ''.join(decrypted_message_characters) | |
print(decrypted_message) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment