2019-08-19 21:37:49 +08:00
|
|
|
def atbash():
|
2019-05-27 00:40:04 +08:00
|
|
|
output=""
|
2019-08-19 21:37:49 +08:00
|
|
|
for i in input("Enter the sentence to be encrypted ").strip():
|
2019-06-05 09:09:04 +08:00
|
|
|
extract = ord(i)
|
|
|
|
if 65 <= extract <= 90:
|
2019-08-19 21:37:49 +08:00
|
|
|
output += chr(155-extract)
|
2019-06-05 09:09:04 +08:00
|
|
|
elif 97 <= extract <= 122:
|
2019-08-19 21:37:49 +08:00
|
|
|
output += chr(219-extract)
|
2019-05-27 00:40:04 +08:00
|
|
|
else:
|
2019-08-19 21:37:49 +08:00
|
|
|
output += i
|
2019-06-05 09:09:04 +08:00
|
|
|
print(output)
|
2019-05-27 00:40:04 +08:00
|
|
|
|
2019-07-08 23:27:51 +08:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2019-08-19 21:37:49 +08:00
|
|
|
atbash()
|