Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions Caesar_Cipher.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@

# BETTER COPY


def encrypt(text, shift):
newEn = ''
for count in text:
Expand All @@ -65,7 +66,7 @@ def encrypt(text, shift):
else:
newEn += alphabet[en]
# print(en)
print(newEn)
print(f"The encode text is {newEn}") # newEn)


def decrypt(text, shift):
Expand All @@ -74,9 +75,10 @@ def decrypt(text, shift):
getDecry = alphabet.index(check) - shift
deNew += alphabet[getDecry]

print(deNew)

print(f"The decoded text is {deNew}")

encrypt(text=text, shift=shift)

decrypt(text=text, shift=shift)
if direction == "encode":
encrypt(text=text, shift=shift)
elif direction == "decode":
decrypt(text=text, shift=shift)