Skip to content

Commit a7b34a4

Browse files
authored
Update CaesarsCypherEncryptor.py
Bug fixes
1 parent 60c14e5 commit a7b34a4

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

CaesarsCypherEncryptor.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
1+
import time
2+
13
def encypt_func(txt, s):
24
result = ""
3-
45
for i in range(len(txt)):
56
char = txt[i]
6-
77
if (char.isupper()):
88
result += chr((ord(char) + s - 64) % 26 + 65)
99
else:
1010
result += chr((ord(char) + s - 96) % 26 + 97)
11-
return result
12-
13-
#Enter here
14-
txt = "Created by Random Demon"
11+
return result
12+
13+
txt = input("What would you like to encrypt?")
1514
s = 4
16-
15+
16+
time.sleep(1)
1717
print("Plain txt : " + txt)
18+
time.sleep(1)
1819
print("Shift pattern : " + str(s))
19-
print("Cipher: " + encypt_func(txt, s))
20+
time.sleep(1)
21+
print("Cipher: " + encypt_func(txt, s))
22+
time.sleep(3)

0 commit comments

Comments
 (0)