From 3a98cdab6e8298452368f689bb7d1ee5c0311d2e Mon Sep 17 00:00:00 2001 From: Srivaishnavi Yaddanapudi <127314796+Y-Srivaishnavi@users.noreply.github.com> Date: Tue, 29 Oct 2024 17:34:37 +0530 Subject: [PATCH] Change `N` into lowercase --- ciphers/rot13.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ciphers/rot13.py b/ciphers/rot13.py index 60a380ef3..9a04c05df 100644 --- a/ciphers/rot13.py +++ b/ciphers/rot13.py @@ -14,13 +14,13 @@ def apply_rot13(s: str) -> str: """ if not isinstance(s, str): return "The input must be a string. Please try again." - N = 13 + n = 13 out = "" for c in s: if "A" <= c <= "Z": - out += chr(ord("A") + (ord(c) - ord("A") + N) % 26) + out += chr(ord("A") + (ord(c) - ord("A") + n) % 26) elif "a" <= c <= "z": - out += chr(ord("a") + (ord(c) - ord("a") + N) % 26) + out += chr(ord("a") + (ord(c) - ord("a") + n) % 26) else: out += c return out