subject

Suppose you are given a text file. Design a Python3 program to encrypt/decrypt that text file as follows:
If the character is an upper case character then shift that character forward, s characters forward in the alphabet.
If the character is a lower case character then shift that character backwards, s characters backwards in the alphabet.
If the character is a numeric character then shift that character also backwards, s characters backwards in the 1-digit numbers set {0,1,2,3,4,5,6,7,8,9}.
You must design two functions; one to encrypt. The other one is to decrypt. All white space and punctuation marks must be ignored(cannot be changed). If you reach Z, or A, the shifting may continue as a cycle(A comes after Z, Z comes before A). Both files (original text file and the encrypted text file) must be stored in the working directory of Python.
An example;
Let s=1 and the text file:
11300Hello World
Then encoded text file;
002991dkkn Xnqke

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 02:00, kayladgranger
Which demographic challenge is europe currently experiencing? a. an aging and decreasing population b. a baby boomc. an unequal distribution between males and females d. a large group of teenagers moving through the school system(i chose a but i'm unsure)
Answers: 1
image
Computers and Technology, 23.06.2019 02:30, chaaaa
People with high self-esteem: accept their strengths and weaknesses. believe that failed experiences are failures of their whole self. feel good about who they are only when they reach total success. need positive external experiences to counteract negative feelings that constantly plague them.
Answers: 1
image
Computers and Technology, 23.06.2019 07:30, emilyplays474
What key should you press and hold to select and open multiple files at one time? enter alt control esc
Answers: 1
image
Computers and Technology, 23.06.2019 22:00, bb1593
Jackson, who works in the finance department of a company, is holding a seminar for other employees on how to file taxes. only three employees sign up to attend the seminar. which device can he use to share his presentation with a group of three employees?
Answers: 1
You know the right answer?
Suppose you are given a text file. Design a Python3 program to encrypt/decrypt that text file as fol...

Questions in other subjects:

Konu
Social Studies, 27.01.2021 14:00
Konu
Spanish, 27.01.2021 14:00