Python/ciphers/atbash.py

16 lines
363 B
Python
Raw Normal View History

def atbash():
2019-05-26 16:40:04 +00:00
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)
2019-05-26 16:40:04 +00:00
else:
output += i
print(output)
2019-05-26 16:40:04 +00:00
if __name__ == '__main__':
atbash()