Skip to content

Instantly share code, notes, and snippets.

@dipo1
Last active August 12, 2020 12:51
Show Gist options
  • Save dipo1/17e2037304e817266bdf6cc314e1efd4 to your computer and use it in GitHub Desktop.
Save dipo1/17e2037304e817266bdf6cc314e1efd4 to your computer and use it in GitHub Desktop.
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