From 0f635eef134b27e065457275925084fe37cb9d44 Mon Sep 17 00:00:00 2001 From: pythonboi Date: Tue, 14 Sep 2021 02:17:41 -0400 Subject: [PATCH 1/2] add decrypt function --- Caesar_Cipher.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Caesar_Cipher.py b/Caesar_Cipher.py index 154b252..870ad6c 100644 --- a/Caesar_Cipher.py +++ b/Caesar_Cipher.py @@ -68,4 +68,14 @@ def encrypt(text, shift): print(newEn) -encrypt(text=text, shift=shift) \ No newline at end of file +def decrypt(text, shift): + deNew = '' + for check in text: + getDecry = alphabet.index(check) - shift + deNew += alphabet[getDecry] + print(deNew) + + + encrypt(text=text, shift=shift) + +decrypt(text=text, shift=shift) From e82486c7f3fc329c4ddfd2e2d53fdc030cf1884a Mon Sep 17 00:00:00 2001 From: pythonboi Date: Tue, 14 Sep 2021 02:20:27 -0400 Subject: [PATCH 2/2] fix identation function issue with encrypt --- Caesar_Cipher.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Caesar_Cipher.py b/Caesar_Cipher.py index 870ad6c..25a49ad 100644 --- a/Caesar_Cipher.py +++ b/Caesar_Cipher.py @@ -73,9 +73,10 @@ def decrypt(text, shift): for check in text: getDecry = alphabet.index(check) - shift deNew += alphabet[getDecry] + print(deNew) - encrypt(text=text, shift=shift) +encrypt(text=text, shift=shift) decrypt(text=text, shift=shift)