Python/ciphers/atbash.py

16 lines
369 B
Python
Raw Normal View History

def atbash():
2019-10-05 05:14:13 +00:00
output = ""
for i in input("Enter the sentence to be encrypted ").strip():
extract = ord(i)
if 65 <= extract <= 90:
2019-10-05 05:14:13 +00:00
output += chr(155 - extract)
elif 97 <= extract <= 122:
2019-10-05 05:14:13 +00:00
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
2019-10-05 05:14:13 +00:00
if __name__ == "__main__":
atbash()