forked from TheAlgorithms/Python
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAtbash.py
More file actions
Latest commit
21 lines (18 loc) · 466 Bytes
/
Copy pathAtbash.py
File metadata and controls
21 lines (18 loc) · 466 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
try: # Python 2
raw_input
unichr
exceptNameError: # Python 3
raw_input=input
unichr=chr
defAtbash():
output=""
foriinraw_input("Enter the sentence to be encrypted ").strip():
extract=ord(i)
if65<=extract<=90:
output+=unichr(155-extract)
elif97<=extract<=122:
output+=unichr(219-extract)
else:
output+=i
print(output)
Atbash()