-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdecryption_2.py
More file actions
31 lines (22 loc) · 847 Bytes
/
decryption_2.py
File metadata and controls
31 lines (22 loc) · 847 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Decryption 1 - Caesar's Cipher
plainnya=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q",
"R","S","T","U","V","W","X","Y","Z"," "]
ciphernya=["11","22","32","41","31","21","23","24","34","33","43","42","51","52","53",
"12","13","14","44","54","35","25","15","45","55","Z"," "]
bil_huruf=[]
sente=input("Sentence :")
for i in range(len(sente)):
for j in range(len(ciphernya)):
if (sente[i]==" "):
bil_huruf.append(26)
break
if i==len(sente)-1:
break
else:
sentenya=sente[i]+sente[i+1]
if ciphernya[j]==sentenya:
bil_huruf.append(j)
print("Result :")
for k in range(len(bil_huruf)):
print(plainnya[bil_huruf[k]],end=" ")
print("\n")