Page 1 of 1

Help me with modifying my code. Instruction: Create a module that decrypts the following message. Lezi$e$kviex$wyqqiv$fv

Posted: Sun May 15, 2022 1:17 pm
by answerhappygod
Help me with modifying my code.
Help Me With Modifying My Code Instruction Create A Module That Decrypts The Following Message Lezi E Kviex Wyqqiv Fv 1
Help Me With Modifying My Code Instruction Create A Module That Decrypts The Following Message Lezi E Kviex Wyqqiv Fv 1 (6.8 KiB) Viewed 66 times
Instruction:
Create a module that decrypts the following message.
Lezi$e$kviex$wyqqiv$fvieo The original
message was encrypted using a Caesar Cypher by four characters.
My code in python:
code= input("Enter the coded text: ")
distance= int(input("Enter the distance value: "))
plainText= ""
for txt in code:
ordvalue= ord(txt)
cipherValue = ordvalue - distance
if cipherValue < ord("a"):
cipherValue= ord("z") - \

(distance - (ord("a") - ordvalue - 1))
plainText += chr(cipherValue)
print(plainText)
Enter the coded text: Lezi$e$kviex$wyqqiv$fvieo Enter the distance value: 4 #ave?agreat2 summer2 break