how to encrypt """ File: decrypt.py Project 4.3 Decypts a file of encrypted text. and prints the result. The other input is the distance value. """ code = raw_input("Enter the coded text: ") distance = input("Enter the distance value: ") plainText = '' for ch in code: ordValue = ord(ch) cipherValue = ordValue - distance if cipherValue

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter13: File Input And Output
Section: Chapter Questions
Problem 6PE
icon
Related questions
Question
how to encrypt
"""
File: decrypt.py
Project 4.3

Decypts a file of encrypted text. and prints
the result. The other input is the distance value.
"""

code = raw_input("Enter the coded text: ")
distance = input("Enter the distance value: ")
plainText = ''
for ch in code:
ordValue = ord(ch)
cipherValue = ordValue - distance
if cipherValue <ord('a'):
cipherValue = ord('z') - (distance - \
(ordValue - ord('a')) - 1)
plainText += chr(cipherValue)
print plainText
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
InputStream
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT