Answered step by step
Verified Expert Solution
Question
1 Approved Answer
What is wrong with the code that was written? Strings and Text Files (Exercise 1) Due on Apr 30 at 6 PM EDT +encrypt.py FAILED:
What is wrong with the code that was written?
Strings and Text Files (Exercise 1) Due on Apr 30 at 6 PM EDT +encrypt.py FAILED: Encryption I Strings and Text Flles 1 ata input("n Enter text for encryption:" 2 dist int(input(n Enter the value for Distance: ")) 3 datum = "" 4 for cha in data: INPUT 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. abcde 128 val ord(cha) cipher-val = val + dist if cipher val ord('z: OUTPUT cipher val ord('a')+dist (ord('z) val + 1) 18 11 print('n Encrypted Text:') 12 print(datum) datum datum chr(cipher_val) Enter text for encryption: abcde Enter the value for Distance: 128 Encrypted Text: RESU Keywords searched for in your program's output. abcde EXPECTED OUTPUT abcde FAILED: Encryption II PASSED: Encryption IlIStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started