We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f17ee9e commit 7a87c76Copy full SHA for 7a87c76
1 file changed
CaesarsCypherDecryptor.py
@@ -0,0 +1,22 @@
1
+import time
2
+
3
+def encypt_func(txt, s):
4
+ result = ""
5
+ for i in range(len(txt)):
6
+ char = txt[i]
7
+ if (char.isupper()):
8
+ result += chr((ord(char) + s - 64) % 26 + 65)
9
+ else:
10
+ result += chr((ord(char) + s - 96) % 26 + 97)
11
+ return result
12
13
+txt = input("What would you like to decrypt?")
14
+s = 20
15
16
+time.sleep(1)
17
+print("Plain txt : " + txt)
18
19
+print("Shift pattern : " + str(s))
20
21
+print("Cipher: " + encypt_func(txt, s))
22
+time.sleep(3)
0 commit comments