Question: Complete the code to get the CORRECT output without making major changes. Thank you. PYTHON The transposition cipher can be generalized to any number of

Complete the code to get the CORRECT output without making major changes. Thank you.
PYTHON The transposition cipher can be generalized to any number of rails. Write a function to implement a three-rail fence cipher that takes every third character and puts it on one of the three rails. Test your algorithm with two sample input as shown below. PlainText: ABCDEFGHI CipherText: CFIBEHADG PlainText: JACK IN THE BOX CipherText: CIT XA EOJKNHB Python Drives Melnsane.py - C:/Users/17737/OneDrive/Desktop/Python Drives Melnsane.py (3.8.4) *Python 3.8.4 Shell* File Edit Shell Debug Options Window Help Python 3.8.4 (tags/v3.8.4:dfa645a, Jul 13 2020, 16:46:45) [MSC v.1924 64 bit (AMA D64)] on win32 Type "help", "copyright", "credits" or "license ()" for more information. File Edit Format Run Options Window Help 1 def encryption (plainText): 2 evenChars="" 3 oddChars="" 4 charCount=0 5 for ch in plaintext: if charCount % 3 == 0: evenChars = evenChars+ch 8 9 else: 10 oddChars = oddChars + ch 11 charCount = charCount + 1 12 cipherText = oddChars + evenChars 13 return cipherText 14 15 plaintext = input ("Enter message: ") 16 cipherText = encryption (plaintext) 17 print ("Encrypted message : ", cipherText) 18 19 20 21 ======= RESTART: C:/Users/17737/OneDrive/Desktop/PythonDrivesMeInsane.py Enter message: ABCDEFGHI Encrypted message : BCEFHIADG >>> >>> >>> Please correct & complete the code to get the correct output. Thank You. 131
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
