Skip to content

Instantly share code, notes, and snippets.

@nozma
Last active August 16, 2017 14:06
Show Gist options
  • Select an option

  • Save nozma/437d7afd751ca362fb953b5728bbcd91 to your computer and use it in GitHub Desktop.

Select an option

Save nozma/437d7afd751ca362fb953b5728bbcd91 to your computer and use it in GitHub Desktop.
# coding: utf-8
def cipher(S):
result = []
for i in range(len(S)):
if(S[i].islower()):
result.append(chr(219 - ord(S[i])))
else:
result.append(S[i])
return ''.join(result)
S = "abcDe"
print(cipher(S))
print(cipher(cipher(S)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment