If you want to know your own coding

New if you wanna make coding def encrypt(text, shift): result = "" for char in text: if char.isalpha(): shift_base = 65 if char.isupper() else 97 result += chr((ord(char) - shift_base + shift) % 26 + shift_base) else: result += char return result def decrypt(text, shift): return encrypt(text, -shift) print("=== Secret Code Translator ===") choice = input("Encrypt or Decrypt? (e/d): ").lower() message = input("Enter your message: ") shift = int(input("Enter shift (1-25): ")) if choice == "e": print("

Apr 12, 2025 - 20:28
 0
If you want to know your own coding

New if you wanna make coding
def encrypt(text, shift):
result = ""
for char in text:
if char.isalpha():
shift_base = 65 if char.isupper() else 97
result += chr((ord(char) - shift_base + shift) % 26 + shift_base)
else:
result += char
return result

def decrypt(text, shift):
return encrypt(text, -shift)

print("=== Secret Code Translator ===")
choice = input("Encrypt or Decrypt? (e/d): ").lower()
message = input("Enter your message: ")
shift = int(input("Enter shift (1-25): "))

if choice == "e":
print("