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, 23.06.2019 01:30
In deadlock avoidance using banker’s algorithm, what would be the consequence(s) of: (i) a process declaring its maximum need as maximum possible for each resource. in other words, if a resource a has 5 instances, then each process declares its maximum need as 5. (ii) a process declaring its minimum needs as maximum needs. for example, a process may need 2-5 instances of resource a. but it declares its maximum need as 2.
Answers: 3
question
Computers and Technology, 23.06.2019 15:30
Hey so i was just trying out some game hacks so i took a paste from online and built it in my visual studio and then suddenly my computer was working or clicking on stuff on its own am i hacked?
Answers: 1
question
Computers and Technology, 24.06.2019 00:00
Visualizing a game of “tag” to remember the meaning of contagious
Answers: 3
question
Computers and Technology, 24.06.2019 09:50
Suppose you are an ad-serving company and you maintain a log of cookie data for ads you serve to the web pages for a particular vendor (say amazon). a. how can you use this data to determine which are the best ads? b. how can you use this data to determine which are the best ad formats? c. how could you records of past ads and ad clicks to determine which ads to send to a given ip address? d. how could you use this data to determine how well the technique you used in your answer to part c was working? e. how could you use this data to determine that a given ip address is used by more than one person? f. how does having this data give you a competitive advantage vis-à-vis other ad-serving companies?
Answers: 2
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, 31.03.2020 18:21
question
Mathematics, 31.03.2020 18:21
Questions on the website: 13722363