Write a script that inputs a line of plaintext and a distance value and outputs an encrypted text using a Caesar cipher. The script should work for any printable characters. (Python is needed for this problem)

Script that inputs a line of plaintext and a distance value and outputs an encrypted text using a Caesar cipher:
Paste the code from below and indent where necessary (spacing) as shown in the attached image.
Python Code:
#Prompting the user to input the text to be encrypted
text = input(“Please enter any text: “)
#Prompting the user to input the distance
d = int(input(“Please enter the distance : “))
encryptedCode = “”
#Logic for encrypting
for character in text:
#ord returns int value for unicode
oV = ord(character)
c = oV + d
if c > ord(‘z’):
c = ord(‘a’) + d – (ord(‘z’) – oV + 1)
encryptedCode = encryptedCode + chr(c)
#Printing the encrypted text
print(‘Encrypted text: ‘+encryptedCode)
https://d2vlcm61l7u1fs.cloudfront.net/media%2F6a9%2F6a939863-7b48-4e8b-b738-e0907462bd73%2Fphph6zBRn.png
Sample Output:
https://d2vlcm61l7u1fs.cloudfront.net/media%2F5e1%2F5e1a211a-7103-4ffa-a545-936e95e84943%2FphprJOm3W.png
 
“Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!”

What Students Are Saying About Us

.......... Customer ID: 12*** | Rating: ⭐⭐⭐⭐⭐
"Honestly, I was afraid to send my paper to you, but splendidwritings.com proved they are a trustworthy service. My essay was done in less than a day, and I received a brilliant piece. I didn’t even believe it was my essay at first 🙂 Great job, thank you!"

.......... Customer ID: 14***| Rating: ⭐⭐⭐⭐⭐
"The company has some nice prices and good content. I ordered a term paper here and got a very good one. I'll keep ordering from this website."

"Order a Custom Paper on Similar Assignment! No Plagiarism! Enjoy 20% Discount"