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

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 07:00
You will be given two character arrays of the same size, one will contain a number of ships. ships will move around the character array based on which way they are facing and the route they are on. routes are given in the other array. the route consists of '-' and '|' for straight paths, '\' and '/' for curves, and '+' for intersections. there are ships on these routes. ships always face a direction, '^' for up, '> ' for right, 'v' for down, and '< ' for left. any time the ships hit a '\' or a '/' it will turn as you would expect a ship to turn (e.g. a '^' that moves into a '/' will turn right). at an intersection, ships will always continue straight through. all ships move at the same speed, ships take turns moving and all ships move during one 'tick'. the one in the most top left goes first, followed by those to its right, then the ones in the next row. it iterates along the rows and then down the columns. each ship moves one space on its turn moving along the route. your function needs to return the position of the first collision between two ships and the number of ticks before the crash occurred.
Answers: 2
question
Computers and Technology, 22.06.2019 09:30
My mom and i are moving and we don’t have wifi for the next week, i want to know if using a using a hotspot with unlimited data is better than using regular wifi. i’m considering cost, speed, and data sacrifices.
Answers: 1
question
Computers and Technology, 23.06.2019 05:20
Which operating system is a version of linux?
Answers: 1
question
Computers and Technology, 23.06.2019 22:30
The output voltage of a power supply is assumed to be normally distributed. sixteen observations are taken at random on voltage are as follows: 10.35, 9.30, 10.00, 9.96, 11.65, 12.00, 11.25, 9.58, 11.54, 9.95, 10.28, 8.37, 10.44, 9.25, 9.38, and 10.85
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
question
Mathematics, 13.11.2019 18:31
question
Mathematics, 13.11.2019 18:31
Questions on the website: 13722367