2019-06-05 03:09:04 +02:00
|
|
|
|
try: # Python 2
|
|
|
|
|
|
raw_input
|
|
|
|
|
|
unichr
|
|
|
|
|
|
except NameError: # Python 3
|
|
|
|
|
|
raw_input = input
|
|
|
|
|
|
unichr = chr
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-26 22:10:04 +05:30
|
|
|
|
def Atbash():
|
|
|
|
|
|
output=""
|
2019-06-05 03:09:04 +02:00
|
|
|
|
for i in raw_input("Enter the sentence to be encrypted ").strip():
|
|
|
|
|
|
extract = ord(i)
|
|
|
|
|
|
if 65 <= extract <= 90:
|
|
|
|
|
|
output += unichr(155-extract)
|
|
|
|
|
|
elif 97 <= extract <= 122:
|
|
|
|
|
|
output += unichr(219-extract)
|
2019-05-26 22:10:04 +05:30
|
|
|
|
else:
|
|
|
|
|
|
output+=i
|
2019-06-05 03:09:04 +02:00
|
|
|
|
print(output)
|
2019-05-26 22:10:04 +05:30
|
|
|
|
|
2019-07-08 17:27:51 +02:00
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
|
Atbash()
|