Skip to content

Added A1Z26 Cipher #1914

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Apr 29, 2020
Prev Previous commit
Next Next commit
Condensed encode function to a single line
  • Loading branch information
LethargicLeprechaun committed Apr 29, 2020
commit 6e756b5b13695a2e22c5d8d0c750aed1418661f7
5 changes: 1 addition & 4 deletions ciphers/a1z26.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ def encode(plain : str) -> list:
>>> encode("myname")
[13, 25, 14, 1, 13, 5]
"""
result = []
for elem in plain:
result.append(ord(elem) - 96)
return result
return [ord(elem) - 96 for elem in plain]

def decode(encoded : list) -> str:
"""
Expand Down