Python/ciphers/atbash.py
Christian Clauss 47a9ea2b0b
Simplify code by dropping support for legacy Python (#1143)
* Simplify code by dropping support for legacy Python

* sort() --> sorted()
2019-08-19 15:37:49 +02:00

16 lines
363 B
Python

def atbash():
output=""
for i in input("Enter the sentence to be encrypted ").strip():
extract = ord(i)
if 65 <= extract <= 90:
output += chr(155-extract)
elif 97 <= extract <= 122:
output += chr(219-extract)
else:
output += i
print(output)
if __name__ == '__main__':
atbash()