From 10cd1b3fe034e66b153caa44a5d5908a04a8a403 Mon Sep 17 00:00:00 2001 From: pythonboi Date: Wed, 15 Sep 2021 11:40:08 -0400 Subject: [PATCH] remove commented code for more readability --- Caesar_Cipher.py | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/Caesar_Cipher.py b/Caesar_Cipher.py index e930906..f5f79d1 100644 --- a/Caesar_Cipher.py +++ b/Caesar_Cipher.py @@ -5,8 +5,6 @@ text = input("Type your message:\n").lower() shift = int(input("Type the shift number:\n")) -# print(len(alphabet)) -# newText = text.split() # # # def encrypt(text, shift): @@ -50,7 +48,7 @@ # shift += 1 # -# BETTER COPY +# BETTER COPY/Solution def encrypt(text, shift): @@ -60,32 +58,18 @@ def encrypt(text, shift): getLen = len(alphabet) if en >= getLen: total = en - getLen - fw = alphabet[total] newEn += fw - # if en >= len(alphabet): - # fw = alphabet.index("a") + shift - # fw -= 1 - # lw = alphabet.index(count) - shift - # newEn += alphabet[fw] - # newEn += alphabet[nw] else: newEn += alphabet[en] - # print(en) - # print(total) - # print(fw) + print(f"The encode text is {newEn}") # newEn) def decrypt(text, shift): deNew = '' - for check in text: - # meCheck = alphabet.index(check) + shift - # if meCheck >= 25: - - # if alphabet[check] >= 25: - # alphabet.index('a') + for check in text getDecry = alphabet.index(check) - shift deNew += alphabet[getDecry]