-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcaesar_cipher.py
48 lines (40 loc) · 1.2 KB
/
caesar_cipher.py
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
def caesarcipher(b,s):
a="abcdefghijklmnoprstuvwxyz"
x=""
for i in range(len(s)):
for j in range(len(a)):
if s[i] is a[j]:
break
x+=b[j]
return x
def makeitnormal(b,s):
a="abcdefghijklmnoprstuvwxyz"
x=""
for i in range(len(s)):
for j in range(len(a)):
if s[i] is b[j]:
break
x+=a[j]
return x
def changekey(b):
inp=input("please enter a number for change the key: ")
for i in inp:
temp=b[0]
b=b.replace(b[0],"")
b+=temp
return b
def editor(s):
x=""
for i in s:
if i.isalpha():
if i.isupper():
x+=i.lower()
else:
x+=i
return x
def checkfile():
file=open("caesar.txt","r")
key=file.readline()
def caesarmenu():
a="abcdefghijklmnoprstuvwxyz"
b="abcdefghijklmnoprstuvwxyz"