mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-01-18 16:27:02 +00:00
Add files via upload (#396)
This commit is contained in:
parent
7f4f565e62
commit
5be32f4022
14
ciphers/Atbash.py
Normal file
14
ciphers/Atbash.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
def Atbash():
|
||||
inp=raw_input("Enter the sentence to be encrypted ")
|
||||
output=""
|
||||
for i in inp:
|
||||
extract=ord(i)
|
||||
if extract>=65 and extract<=90:
|
||||
output+=(unichr(155-extract))
|
||||
elif extract>=97 and extract<=122:
|
||||
output+=(unichr(219-extract))
|
||||
else:
|
||||
output+=i
|
||||
print output
|
||||
|
||||
Atbash() ;
|
Loading…
Reference in New Issue
Block a user