mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-27 23:11:09 +00:00
47a9ea2b0b
* Simplify code by dropping support for legacy Python * sort() --> sorted()
16 lines
363 B
Python
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()
|