subject

Mason and Meade designed an encryption method to exchange secret messages. There are two modes: 'odd' and 'even'. In the 'odd' mode, the actual letters are placed at odd positions (1st, 3rd, 5th letter, etc.) with random letters at even positions; while in the 'even' mode, the actual letters are placed at even positions (2nd, 4th, 6th letters, etc.) with random letters at other positions. Please construct a function decript that takes two arguments: a string type argument text, which is an encrypted text; and another string type argument mode, with a value of 'odd' or 'even'. The function has to print out the decripted text from the given text and mode. Below is two examples of how the function should be called: decrypt('ABCDEFGHIJK', 'odd') decrypt('LITLEOLVIETYPOAU', 'even') The output would be: ACEGIK ILOVEYOU Note: The index of a string starts from 0, i. e., the 1st letter is at index 0, the 2nd at index 1, etc.. print(text[1::2]) def decrypt(text, mode): print(text[1:2:]) if mode == 'odd': print(text[:2:]) elif mode == 'even': print(text[::2]). print(text[0,2,4,...]). print(text[1:-1:2]) print(text[0:-1:2]) print(text[,,2])

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 16:30
You have inserted new slides based on a word outline. how do you format these new slides to match the powerpoint presentation formatting? a. select all slides in the presentation and click format on the home tab. b. select the new slides and click reset on the home tab. c. select all slides in the presentation and click reset on the home tab. d. select the new slides and click format on the home tab.
Answers: 2
question
Computers and Technology, 21.06.2019 21:30
Asuccessful format string attack attempted to steal user account information by reading from unauthorized memory. answer the followings with proper explanation a)this attack will lead to violation of which security policies?
Answers: 2
question
Computers and Technology, 23.06.2019 11:00
Describe three characteristics of at-risk drivers. a. b. c. describe three characteristics of safe drivers. a. b. c. describe three driver errors that could cause a collision. a. b. c. how will this information affect you as a driver now and in the future? (2-3 sentences)
Answers: 2
question
Computers and Technology, 24.06.2019 14:30
Alison is having a hard time at work because hee inbox is flooded with emails every day. some of these emails are unsolicited. some of other she don’t need. which action should she take to better manager her emails?
Answers: 1
You know the right answer?
Mason and Meade designed an encryption method to exchange secret messages. There are two modes: 'odd...
Questions
question
Social Studies, 25.08.2019 05:10
question
History, 25.08.2019 05:10
Questions on the website: 13722361