Skip to content

Instantly share code, notes, and snippets.

@ahmed4end
Created February 7, 2020 19:10
Show Gist options
  • Save ahmed4end/511b494f981e96ef580f2949cb3f43f1 to your computer and use it in GitHub Desktop.
Save ahmed4end/511b494f981e96ef580f2949cb3f43f1 to your computer and use it in GitHub Desktop.
txt = "Hello"
alpha = [chr(i) for i in range(65, 91)]
res = []
for i in [txt[i:i+3] for i in range(0, len(txt), 3)]:
for x, y in zip([3, 5, 7], i):res.append(alpha[(ord(y)%65+x)%26])
print("".join(res))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment