Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Use Python 3.7 and based on the test code ## encode and decode functions using lists def create elist (codestring) def create_dlist (codestring) def encode_list
Use Python 3.7 and based on the test code
## encode and decode functions using lists def create elist (codestring) def create_dlist (codestring) def encode_list (e_list, plaintext) def decode list (d_list, ciphertext) pass pass pass pass def testdecodelist (self) codest ring= ("BCDEFGHlJKLMNOPQRSTUWXYZA") self. assertEqual (decode list (create_dlist (codestring), "CDE"BCD) self. assertEqual (decode list (create dlist (codestring), "ZZZAB"), "YYYZA") self. assertNotEqual (decode list (create dlist (codestring), "ABC), "ABC") def testdecodelistwithextras (self) codestring-(JMBCYEKLFDGUVWHINXRTOSPZQA") self.assertEqual (decode list (create dlist (codestring), "TMB,-CY: "), "ABC, DE") self. assertEqual (decode list (create dlist (codestring), self. assertEqual (decode_list (create dlist (codestring), 1234567.."), 1234567..) def testdecodelistwithlowercase (self) codest ring= ("JMBCYEKLFDGUTy/H1NXRTOSPZQA") self.assertEqual(decode list (create dlist (codest ring), "Ib,-cy::"), self. assertEqual (decode list (create_dlist (codestring)," "ABC, DE : :") def testencodelist (self) codest ring= ("BCDEFGHlJKLMNOPQRSTUTWXYZA") self.assertEqual (encode-list (create-elist (codest ring), "DER"), FG") self. assertEqual (encode list (create_elist (codestring), "AAAB") BBBC") self. assertNotEqual (encode list (createelist (codestring), "ABC), "ABC") def testencodelistwithlowercase (self) codest ring= (TMBCYEKLFDGUVWHINXRTOSPZQA") self. assertEqual (encode list (create_elist (codestring), "Abc, De:" JMB, -CY self.assertEqual (encode-list (create-elist (code string), " zun#$!"), " APS#$1") self.assertNotEqual (encode-list (create-elist (codest ring), " APS#$!"), " APS#$!") def testencodelistwithextras (self) codestring -("JMBCYEKLFDGUVWHINXRTOSPZQA") self. assertEqual (encode_list (create elist (codestring), ABC, DE::"), "JMB, -CY:") self.assertEqual (encode_list (create-elist (code string)," ZW/#$!. self.assertEqual (encode-list (create-elist (codest ring), "1234567 "), 1234567..) APS#$! ") ## encode and decode functions using lists def create elist (codestring) def create_dlist (codestring) def encode_list (e_list, plaintext) def decode list (d_list, ciphertext) pass pass pass pass def testdecodelist (self) codest ring= ("BCDEFGHlJKLMNOPQRSTUWXYZA") self. assertEqual (decode list (create_dlist (codestring), "CDE"BCD) self. assertEqual (decode list (create dlist (codestring), "ZZZAB"), "YYYZA") self. assertNotEqual (decode list (create dlist (codestring), "ABC), "ABC") def testdecodelistwithextras (self) codestring-(JMBCYEKLFDGUVWHINXRTOSPZQA") self.assertEqual (decode list (create dlist (codestring), "TMB,-CY: "), "ABC, DE") self. assertEqual (decode list (create dlist (codestring), self. assertEqual (decode_list (create dlist (codestring), 1234567.."), 1234567..) def testdecodelistwithlowercase (self) codest ring= ("JMBCYEKLFDGUTy/H1NXRTOSPZQA") self.assertEqual(decode list (create dlist (codest ring), "Ib,-cy::"), self. assertEqual (decode list (create_dlist (codestring)," "ABC, DE : :") def testencodelist (self) codest ring= ("BCDEFGHlJKLMNOPQRSTUTWXYZA") self.assertEqual (encode-list (create-elist (codest ring), "DER"), FG") self. assertEqual (encode list (create_elist (codestring), "AAAB") BBBC") self. assertNotEqual (encode list (createelist (codestring), "ABC), "ABC") def testencodelistwithlowercase (self) codest ring= (TMBCYEKLFDGUVWHINXRTOSPZQA") self. assertEqual (encode list (create_elist (codestring), "Abc, De:" JMB, -CY self.assertEqual (encode-list (create-elist (code string), " zun#$!"), " APS#$1") self.assertNotEqual (encode-list (create-elist (codest ring), " APS#$!"), " APS#$!") def testencodelistwithextras (self) codestring -("JMBCYEKLFDGUVWHINXRTOSPZQA") self. assertEqual (encode_list (create elist (codestring), ABC, DE::"), "JMB, -CY:") self.assertEqual (encode_list (create-elist (code string)," ZW/#$!. self.assertEqual (encode-list (create-elist (codest ring), "1234567 "), 1234567..) APS#$! ")Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started