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, 22.06.2019 16:20
It policy compliance and emerging technologies respond to the following: propose at least three control measures that organizations need to put in place to ensure that they remain complaint with emerging technologies and in a continually changing it environment. examine the correlation of effective configuration management and change control procedures to remain compliant with emerging technologies and it security changes.
Answers: 2
question
Computers and Technology, 23.06.2019 08:30
When you interpret the behavior of others according to your experiences and understanding of the world your evaluation is
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
Me ! evelyn is a manager in a retail unit. she wants to prepare a report on the projected profit for the next year. which function can she use? a. pmt b. round c. division d. what-if analysis
Answers: 2
question
Computers and Technology, 23.06.2019 15:00
In the blank libreoffice writer document, to start the process of entering a date field into a letter, click on the insert menu. edit menu. file menu. fields menu.
Answers: 3
You know the right answer?
Mason and Meade designed an encryption method to exchange secret messages. There are two modes: 'odd...
Questions
Questions on the website: 13722361