Answered step by step
Verified Expert Solution
Link Copied!

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:

image text in transcribed

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 IlI

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management Systems Designing And Building Business Applications

Authors: Gerald V. Post

1st Edition

0072898933, 978-0072898934

More Books

Students also viewed these Databases questions

Question

What is DDL?

Answered: 1 week ago